<!doctype html><html lang="en">
 <head>
  <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  <title>CSS Shapes Module Level 1</title>
  <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
  <meta content="testing" name="csswg-work-status">
  <meta content="ED" name="w3c-status">
  <meta content="CSS Shapes describe geometric shapes for use in CSS. For Level 1, CSS Shapes can be applied to floats. A circle shape on a float will cause inline content to <a>wrap</a> around the circle shape instead of the float&apos;s bounding box." name="abstract">
  <link href="../default.css" rel="stylesheet" type="text/css">
  <link href="../csslogo.ico" rel="shortcut icon" type="image/x-icon">
<style>
  body {
    background: url("https://www.w3.org/StyleSheets/TR/logo-ED") top left no-repeat;
  }
  </style>
  <link href="https://www.w3.org/TR/css-shapes/" rel="canonical">
<script defer src="https://test.csswg.org/harness/annotate.js#!css-shapes-1_dev/css-shapes-1" type="text/javascript"></script>
<style type="text/css">
	.singleImgExample {
		display: block;
		margin: auto;
	}
</style>
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
   regarding paragraph and lists. */
[data-md] > :first-child {
    margin-top: 0;
}
[data-md] > :last-child {
    margin-bottom: 0;
}</style>
<style>/* style-counters */

body {
    counter-reset: example figure issue;
}
.issue {
    counter-increment: issue;
}
.issue:not(.no-marker)::before {
    content: "Issue " counter(issue);
}

.example {
    counter-increment: example;
}
.example:not(.no-marker)::before {
    content: "Example " counter(example);
}
.invalid.example:not(.no-marker)::before,
.illegal.example:not(.no-marker)::before {
    content: "Invalid Example" counter(example);
}

figcaption {
    counter-increment: figure;
}
figcaption:not(.no-marker)::before {
    content: "Figure " counter(figure) " ";
}</style>
<style>/* style-dfn-panel */

.dfn-panel {
    position: absolute;
    z-index: 35;
    height: auto;
    width: -webkit-fit-content;
    width: fit-content;
    max-width: 300px;
    max-height: 500px;
    overflow: auto;
    padding: 0.5em 0.75em;
    font: small Helvetica Neue, sans-serif, Droid Sans Fallback;
    background: #DDDDDD;
    color: black;
    border: outset 0.2em;
}
.dfn-panel:not(.on) { display: none; }
.dfn-panel * { margin: 0; padding: 0; text-indent: 0; }
.dfn-panel > b { display: block; }
.dfn-panel a { color: black; }
.dfn-panel a:not(:hover) { text-decoration: none !important; border-bottom: none !important; }
.dfn-panel > b + b { margin-top: 0.25em; }
.dfn-panel ul { padding: 0; }
.dfn-panel li { list-style: inside; }
.dfn-panel.activated {
    display: inline-block;
    position: fixed;
    left: .5em;
    bottom: 2em;
    margin: 0 auto;
    max-width: calc(100vw - 1.5em - .4em - .5em);
    max-height: 30vh;
}

.dfn-paneled { cursor: pointer; }
</style>
<style>/* style-selflinks */

.heading, .issue, .note, .example, li, dt {
    position: relative;
}
a.self-link {
    position: absolute;
    top: 0;
    left: calc(-1 * (3.5rem - 26px));
    width: calc(3.5rem - 26px);
    height: 2em;
    text-align: center;
    border: none;
    transition: opacity .2s;
    opacity: .5;
}
a.self-link:hover {
    opacity: 1;
}
.heading > a.self-link {
    font-size: 83%;
}
li > a.self-link {
    left: calc(-1 * (3.5rem - 26px) - 2em);
}
dfn > a.self-link {
    top: auto;
    left: auto;
    opacity: 0;
    width: 1.5em;
    height: 1.5em;
    background: gray;
    color: white;
    font-style: normal;
    transition: opacity .2s, background-color .2s, color .2s;
}
dfn:hover > a.self-link {
    opacity: 1;
}
dfn > a.self-link:hover {
    color: black;
}

a.self-link::before            { content: "¶"; }
.heading > a.self-link::before { content: "§"; }
dfn > a.self-link::before      { content: "#"; }</style>
<style>/* style-autolinks */

.css.css, .property.property, .descriptor.descriptor {
    color: #005a9c;
    font-size: inherit;
    font-family: inherit;
}
.css::before, .property::before, .descriptor::before {
    content: "‘";
}
.css::after, .property::after, .descriptor::after {
    content: "’";
}
.property, .descriptor {
    /* Don't wrap property and descriptor names */
    white-space: nowrap;
}
.type { /* CSS value <type> */
    font-style: italic;
}
pre .property::before, pre .property::after {
    content: "";
}
[data-link-type="property"]::before,
[data-link-type="propdesc"]::before,
[data-link-type="descriptor"]::before,
[data-link-type="value"]::before,
[data-link-type="function"]::before,
[data-link-type="at-rule"]::before,
[data-link-type="selector"]::before,
[data-link-type="maybe"]::before {
    content: "‘";
}
[data-link-type="property"]::after,
[data-link-type="propdesc"]::after,
[data-link-type="descriptor"]::after,
[data-link-type="value"]::after,
[data-link-type="function"]::after,
[data-link-type="at-rule"]::after,
[data-link-type="selector"]::after,
[data-link-type="maybe"]::after {
    content: "’";
}

[data-link-type].production::before,
[data-link-type].production::after,
.prod [data-link-type]::before,
.prod [data-link-type]::after {
    content: "";
}

[data-link-type=element],
[data-link-type=element-attr] {
    font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace;
    font-size: .9em;
}
[data-link-type=element]::before { content: "<" }
[data-link-type=element]::after  { content: ">" }

[data-link-type=biblio] {
    white-space: pre;
}</style>
 <body class="h-entry">
  <div class="head">
   <p data-fill-with="logo"><a class="logo" href="https://www.w3.org/"> <img alt="W3C" height="48" src="https://www.w3.org/StyleSheets/TR/2016/logos/W3C" width="72"> </a> </p>
   <h1 class="p-name no-ref" id="title">CSS Shapes Module Level 1</h1>
   <h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Editor’s Draft, <time class="dt-updated" datetime="1970-01-01">1 January 1970</time></span></h2>
   <details>
    <summary>Specification Metadata</summary>
    <div data-fill-with="spec-metadata">
     <dl>
      <dt>This version:
      <dd><a class="u-url" href="https://drafts.csswg.org/css-shapes/">https://drafts.csswg.org/css-shapes/</a>
      <dt>Latest published version:
      <dd><a href="https://www.w3.org/TR/css-shapes/">https://www.w3.org/TR/css-shapes/</a>
      <dt>Previous Versions:
      <dd><a href="http://www.w3.org/TR/2014/CR-css-shapes-1-20140320/" rel="prev">http://www.w3.org/TR/2014/CR-css-shapes-1-20140320/</a>
      <dt>Test Suite:
      <dd><a href="http://test.csswg.org/suites/css-shapes-1_dev/nightly-unstable/">http://test.csswg.org/suites/css-shapes-1_dev/nightly-unstable/</a>
      <dt class="editor">Editors:
      <dd class="editor p-author h-card vcard" data-editor-id="49885"><a class="p-name fn u-email email" href="mailto:ratan@microsoft.com">Rossen Atanassov</a> (<span class="p-org org">Microsoft Corporation</span>)
      <dd class="editor p-author h-card vcard" data-editor-id="46659"><a class="p-name fn u-email email" href="mailto:stearns@adobe.com">Alan Stearns</a> (<span class="p-org org">Adobe</span>)
      <dt class="editor">Former Editor:
      <dd class="editor p-author h-card vcard"><span class="p-name fn">Vincent Hardy</span>
      <dt>Suggest an Edit for this Spec:
      <dd><a href="https://github.com/w3c/csswg-drafts/blob/master/css-shapes-1/Overview.bs">GitHub Editor</a>
      <dt>Issue Tracking:
      <dd><a href="https://github.com/w3c/csswg-drafts/labels/css-shapes-1">GitHub Issues</a>
     </dl>
    </div>
   </details>
   <div data-fill-with="warning"></div>
   <p class="copyright" data-fill-with="copyright"><a href="https://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 1970 <a href="https://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href="https://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="https://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href="https://www.keio.ac.jp/">Keio</a>, <a href="https://ev.buaa.edu.cn/">Beihang</a>). W3C <a href="https://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="https://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document">permissive document license</a> rules apply. </p>
   <hr title="Separator for header">
  </div>
  <div class="p-summary" data-fill-with="abstract">
   <h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2>
   <p>CSS Shapes describe geometric shapes for use in CSS. For Level 1, CSS Shapes can be applied to floats. A circle shape on a float will cause inline content to <a data-link-type="dfn" href="#wrap" id="ref-for-wrap">wrap</a> around the circle shape instead of the float’s bounding box.</p>
    <a href="https://www.w3.org/TR/CSS/">CSS</a> is a language for describing the rendering of structured documents
(such as HTML and XML)
on screen, on paper, etc. 
  </div>
  <h2 class="no-num no-toc no-ref heading settled" id="status"><span class="content">Status of this document</span></h2>
  <div data-fill-with="status">
   <p> This is a public copy of the editors’ draft.
	It is provided for discussion only and may change at any moment.
	Its publication here does not imply endorsement of its contents by W3C.
	Don’t cite this document other than as work in progress. </p>
   <p> <a href="https://github.com/w3c/csswg-drafts/issues">GitHub Issues</a> are preferred for discussion of this specification.
	When filing an issue, please put the text “css-shapes” in the title,
	preferably like this:
	“[css-shapes] <i data-lt>…summary of comment…</i>”.
	All issues and comments are <a href="https://lists.w3.org/Archives/Public/public-css-archive/">archived</a>,
	and there is also a <a href="https://lists.w3.org/Archives/Public/www-style/">historical archive</a>. </p>
   <p> This document was produced by the <a href="https://www.w3.org/Style/CSS/">CSS Working Group</a>. </p>
   <p> This document was produced by a group operating under
	the <a href="https://www.w3.org/Consortium/Patent-Policy/">W3C Patent Policy</a>.
	W3C maintains a <a href="https://www.w3.org/2004/01/pp-impl/32061/status" rel="disclosure">public list of any patent disclosures</a> made in connection with the deliverables of the group;
	that page also includes instructions for disclosing a patent.
	An individual who has actual knowledge of a patent which the individual believes contains <a href="https://www.w3.org/Consortium/Patent-Policy/#def-essential">Essential Claim(s)</a> must disclose the information in accordance with <a href="https://www.w3.org/Consortium/Patent-Policy/#sec-Disclosure">section 6 of the W3C Patent Policy</a>. </p>
   <p> This document is governed by the <a href="https://www.w3.org/2019/Process-20190301/" id="w3c_process_revision">1 March 2019 W3C Process Document</a>. </p>
   <p></p>
  </div>
  <div data-fill-with="at-risk"></div>
  <nav data-fill-with="table-of-contents" id="toc">
   <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
   <ol class="toc" role="directory">
    <li>
     <a href="#intro"><span class="secno">1</span> <span class="content"> Introduction</span></a>
     <ol class="toc">
      <li><a href="#module-interactions"><span class="secno">1.1</span> <span class="content"> Module Interactions</span></a>
      <li><a href="#values"><span class="secno">1.2</span> <span class="content">Values</span></a>
      <li><a href="#animations"><span class="secno">1.3</span> <span class="content">Animated Values</span></a>
      <li><a href="#terminology"><span class="secno">1.4</span> <span class="content"> Terminology</span></a>
     </ol>
    <li><a href="#relation-to-box-model-and-float-behavior"><span class="secno">2</span> <span class="content"> Relation to the box model and float behavior</span></a>
    <li>
     <a href="#basic-shape-functions"><span class="secno">3</span> <span class="content"> Basic Shapes</span></a>
     <ol class="toc">
      <li><a href="#supported-basic-shapes"><span class="secno">3.1</span> <span class="content"> Supported Shapes</span></a>
      <li><a href="#basic-shape-computed-values"><span class="secno">3.2</span> <span class="content"> Computed Values of Basic Shapes</span></a>
      <li><a href="#basic-shape-serialization"><span class="secno">3.3</span> <span class="content"> Serialization of Basic Shapes</span></a>
      <li><a href="#basic-shape-interpolation"><span class="secno">3.4</span> <span class="content"> Interpolation of Basic Shapes</span></a>
     </ol>
    <li><a href="#shapes-from-image"><span class="secno">4</span> <span class="content"> Shapes from Image</span></a>
    <li><a href="#shapes-from-box-values"><span class="secno">5</span> <span class="content"> Shapes from Box Values</span></a>
    <li>
     <a href="#declaring-shapes"><span class="secno">6</span> <span class="content"> Declaring Shapes</span></a>
     <ol class="toc">
      <li><a href="#shape-outside-property"><span class="secno">6.1</span> <span class="content"> Float Area Shape: the <span class="property">shape-outside</span> property</span></a>
      <li><a href="#shape-image-threshold-property"><span class="secno">6.2</span> <span class="content"> Choosing Image Pixels: the <span class="property">shape-image-threshold</span> property</span></a>
      <li><a href="#shape-margin-property"><span class="secno">6.3</span> <span class="content"> Expanding a Shape: the <span class="property">shape-margin</span> property</span></a>
     </ol>
    <li><a href="#acknowledgments"><span class="secno"></span> <span class="content"> Acknowledgments</span></a>
    <li>
     <a href="#change-log"><span class="secno"></span> <span class="content"> Change Log</span></a>
     <ol class="toc">
      <li><a href="#20140320"><span class="secno"></span> <span class="content"> Since <span>March 20th 2014</span></span></a>
      <li><a href="#20140211"><span class="secno"></span> <span class="content"> Since <span>February 11th 2014</span></span></a>
      <li><a href="#20131203"><span class="secno"></span> <span class="content"> Since <span>December 3rd 2013</span></span></a>
      <li><a href="#20130620"><span class="secno"></span> <span class="content"> Since <span>June 20th 2013</span></span></a>
      <li><a href="#20120503"><span class="secno"></span> <span class="content"> Since <span>May 3rd 2012</span></span></a>
      <li><a href="#20111213"><span class="secno"></span> <span class="content"> Since <span>December 13th 2011</span></span></a>
     </ol>
    <li><a href="#priv-sec"><span class="secno">7</span> <span class="content">Privacy and Security Considerations</span></a>
    <li>
     <a href="#conformance"><span class="secno"></span> <span class="content"> Conformance</span></a>
     <ol class="toc">
      <li><a href="#document-conventions"><span class="secno"></span> <span class="content"> Document conventions</span></a>
      <li><a href="#conform-classes"><span class="secno"></span> <span class="content"> Conformance classes</span></a>
      <li>
       <a href="#conform-responsible"><span class="secno"></span> <span class="content"> Requirements for Responsible Implementation of CSS</span></a>
       <ol class="toc">
        <li><a href="#conform-partial"><span class="secno"></span> <span class="content"> Partial Implementations</span></a>
        <li><a href="#conform-future-proofing"><span class="secno"></span> <span class="content"> Implementations of Unstable and Proprietary Features</span></a>
        <li><a href="#conform-testing"><span class="secno"></span> <span class="content"> Implementations of CR-level Features</span></a>
       </ol>
     </ol>
    <li>
     <a href="#index"><span class="secno"></span> <span class="content">Index</span></a>
     <ol class="toc">
      <li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a>
      <li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a>
     </ol>
    <li>
     <a href="#references"><span class="secno"></span> <span class="content">References</span></a>
     <ol class="toc">
      <li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a>
      <li><a href="#informative"><span class="secno"></span> <span class="content">Informative References</span></a>
     </ol>
    <li><a href="#property-index"><span class="secno"></span> <span class="content">Property Index</span></a>
   </ol>
  </nav>
  <main>
   <h2 class="heading settled" data-level="1" id="intro"><span class="secno">1. </span><span class="content"> Introduction</span><a class="self-link" href="#intro"></a></h2>
   <p><em>This section is not normative.</em></p>
   <p>Shapes define arbitrary geometries
	that can be used as CSS values.
	This specification defines properties
	to control the geometry
	of an element’s <a data-link-type="dfn" href="#float-area" id="ref-for-float-area">float area</a>.
	The <a class="property" data-link-type="propdesc" href="#propdef-shape-outside" id="ref-for-propdef-shape-outside">shape-outside</a> property uses shape values
	to define the <span id="ref-for-float-area①">float area</span> for a float.</p>
   <p class="note" role="note"><span>Note:</span> Future levels of CSS Shapes will allow use of shapes
	on elements other than floats.
	Other CSS modules can make use of shapes as well,
	such as CSS Masking <a data-link-type="biblio" href="#biblio-css-masking">[CSS-MASKING]</a> and CSS Exclusions <a data-link-type="biblio" href="#biblio-css3-exclusions">[CSS3-EXCLUSIONS]</a>.</p>
   <p class="note" role="note"><span>Note:</span> If a user agent implements both CSS Shapes
	and CSS Exclusions,
	the <a class="property" data-link-type="propdesc" href="#propdef-shape-outside" id="ref-for-propdef-shape-outside①">shape-outside</a> property defines
	the exclusion area for an exclusion.</p>
   <p class="note" role="note"><span>Note:</span> A future level of CSS Shapes will define a shape-inside property,
	which will define a shape to <a data-link-type="dfn" href="#wrap" id="ref-for-wrap①">wrap</a> content within the element.</p>
   <h3 class="heading settled" data-level="1.1" id="module-interactions"><span class="secno">1.1. </span><span class="content"> Module Interactions</span><a class="self-link" href="#module-interactions"></a></h3>
   <p>This module extends the float features defined in <a data-link-type="biblio" href="#biblio-css2">[CSS2]</a> chapter 9.</p>
   <h3 class="heading settled" data-level="1.2" id="values"><span class="secno">1.2. </span><span class="content">Values</span><a class="self-link" href="#values"></a></h3>
   <p>This specification follows the <a href="https://www.w3.org/TR/CSS21/about.html#property-defs">CSS property definition conventions</a> from <a data-link-type="biblio" href="#biblio-css2">[CSS2]</a>.
	Value types not defined in this specification are defined in CSS Values &amp; Units <a data-link-type="biblio" href="#biblio-css-values-3">[CSS-VALUES-3]</a>.
	Other CSS modules may expand the definitions of these value types.</p>
   <p>In addition to the property-specific values listed in their definitions,
	all properties defined in this specification
	also accept the <a data-link-type="dfn" href="https://drafts.csswg.org/css-values-4/#css-wide-keywords" id="ref-for-css-wide-keywords">CSS-wide keywords</a> keywords as their property value.
	For readability they have not been repeated explicitly.</p>
   <h3 class="heading settled" data-level="1.3" id="animations"><span class="secno">1.3. </span><span class="content">Animated Values</span><a class="self-link" href="#animations"></a></h3>
   <p>It is expected that CSS will include ways
	to animate transitions between styles.
	(The section <a href="https://www.w3.org/TR/css3-transitions/#animatable-types">"Animation of property types"</a> of the <cite>CSS Transitions module</cite> <a data-link-type="biblio" href="#biblio-css3-transitions">[CSS3-TRANSITIONS]</a> is expected to define how different kinds
	of values are interpolated during a transition.)
	In anticipation of that,
	this module includes a line "Animatable" for each property,
	which specifies whether and how values
	of the property can be animated.</p>
   <h3 class="heading settled" data-level="1.4" id="terminology"><span class="secno">1.4. </span><span class="content"> Terminology</span><a class="self-link" href="#terminology"></a></h3>
   <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="wrap|wrapping" data-noexport id="wrap">Wrap</dfn></p>
   <p>This specification uses the term <a data-link-type="dfn" href="#wrap" id="ref-for-wrap②">wrap</a> to refer to flowing content
	around the sides of a <a data-link-type="dfn" href="#float-area" id="ref-for-float-area②">float area</a>,
	defined in <a data-link-type="biblio" href="#biblio-css2">[CSS2]</a> chapter 9.
	Content <span id="ref-for-wrap③">wraps</span> around the right side
	of a left-floated box,
	and content <span id="ref-for-wrap④">wraps</span> around the left side
	of a right-floated box.
	One result of this <span id="ref-for-wrap⑤">wrapping</span> is that line boxes next to a float
	are shortened as necessary
	to avoid intersections with the <span id="ref-for-float-area③">float area</span>.</p>
   <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="float-area">Float area</dfn></p>
   <p>The area used
	for <a data-link-type="dfn" href="#wrap" id="ref-for-wrap⑥">wrapping</a> content
	around a float element.
	The rules for float behavior
	use the sides of the <a data-link-type="dfn" href="#float-area" id="ref-for-float-area④">float area</a> to determine where content flows.
	By default,
	the <span id="ref-for-float-area⑤">float area</span> is the float element’s <a data-link-type="dfn" href="https://drafts.csswg.org/css-box-3/#margin-box" id="ref-for-margin-box">margin box</a> (note this can be different than
	the <span id="ref-for-float-area⑥">float area</span> produced
	by the <a class="css" data-link-type="maybe" href="#valdef-shape-box-margin-box" id="ref-for-valdef-shape-box-margin-box">margin-box</a> value,
	which includes border-radius curvature).
	This specification’s <a class="property" data-link-type="propdesc" href="#propdef-shape-outside" id="ref-for-propdef-shape-outside②">shape-outside</a> property
	can be used to define an arbitrary,
	non-rectangular <span id="ref-for-float-area⑦">float area</span>.</p>
   <h2 class="heading settled" data-level="2" id="relation-to-box-model-and-float-behavior"><span class="secno">2. </span><span class="content"> Relation to the box model and float behavior</span><a class="self-link" href="#relation-to-box-model-and-float-behavior"></a></h2>
   <p>While the boundaries used
	for <a data-link-type="dfn" href="#wrap" id="ref-for-wrap⑦">wrapping</a> inline flow content
	outside a float
	can be defined using shapes,
	the actual box model does not change.
	If the element has specified
	margins, borders or padding
	they will be computed and rendered
	according to the <a data-link-type="biblio" href="#biblio-css3box">[CSS3BOX]</a> module.
	Also, float positioning and stacking are not affected
	by defining a <a data-link-type="dfn" href="#float-area" id="ref-for-float-area⑧">float area</a> with a shape.</p>
   <p>When a shape is used to define
	a <a data-link-type="dfn" href="#float-area" id="ref-for-float-area⑨">float area</a>,
	the shape is clipped
	to the float’s margin box.
	In other words,
	a shape can only ever reduce
	a <span id="ref-for-float-area①⓪">float area</span>,
	not increase it.
	A reduced <span id="ref-for-float-area①①">float area</span> may have no effect
	on some line boxes
	that would normally be affected by the float.
	If a shape does not enclose any area, 
	the shape’s edges are still used 
	to define the <span id="ref-for-float-area①②">float area</span>.</p>
   <p>A <a data-link-type="dfn" href="#float-area" id="ref-for-float-area①③">float area</a> defined by a shape
	may reduce the normal <span id="ref-for-float-area①④">float area</span> on all sides,
	but this does not allow content to <a data-link-type="dfn" href="#wrap" id="ref-for-wrap⑧">wrap</a> on both sides of a float.
	Left floats with a <a class="property" data-link-type="propdesc" href="#propdef-shape-outside" id="ref-for-propdef-shape-outside③">shape-outside</a> still
	only allow content <span id="ref-for-wrap⑨">wrapping</span> on the right side,
	and right floats only allow <span id="ref-for-wrap①⓪">wrapping</span> on the left.</p>
   <div class="example" id="example-39c551b4">
    <a class="self-link" href="#example-39c551b4"></a> 
    <p>In the following example
		the left and right floating <code class="html">img</code> elements
		specify a triangular shape
		using the <a class="property" data-link-type="propdesc" href="#propdef-shape-outside" id="ref-for-propdef-shape-outside④">shape-outside</a> property.</p>
<pre><code>&lt;img class="left" src="hand.svg"/>
&lt;img class="right" src="hand.svg"/>
&lt;p>
  Sometimes a web page’s text content appears to be
  funneling your attention towards a spot on the page
  to drive you to follow a particular link. Sometimes
  you don’t notice.
&lt;/p>

&lt;style type="text/css">
  .left {
    shape-outside: polygon(0 0, 100% 100%, 0 100%);
    float: left;
    width: 40%;
    height: 12ex;
    transform: scaleX(-1);
  }

  .right {
    shape-outside: polygon(100% 0, 100% 100%, 0 100%);
    float: right;
    width: 40%;
    height: 12ex;
  }

  p {
    text-align: center;
  }
&lt;/style>
</code></pre>
    <p><img alt="Using the shape-outside property with floats" class="singleImgExample" src="images/hand-funnel.png"></p>
   </div>
   <div class="example" id="example-c9556a71">
    <a class="self-link" href="#example-c9556a71"></a> 
    <p>Since shapes are clipped to the float’s margin box,
		adding this shape to the left float above
		would result in the same rendering.</p>
<pre><code>shape-outside: polygon(0 0, 500% 500%, 0 500%);
</code></pre>
   </div>
   <div class="example" id="example-e8eedd7c">
    <a class="self-link" href="#example-e8eedd7c"></a> 
    <p>A shape that does not enclose any area
		still has edges that contribute to the <a data-link-type="dfn" href="#float-area" id="ref-for-float-area①⑤">float area</a>.</p>
    <p>This inset shape is a vertical line positioned
		at the midpoint of the reference box. 
		This midpoint edge is used as the edge 
		of the float area for wrapping content.</p>
<pre><code>shape-outside: inset(0% 50% 0% 50%);
</code></pre>
    <p>If inset values add up to more than the width, <a href="https://www.w3.org/TR/css3-background/#corner-overlap">CSS Backgrounds 3 §5.5 Overlapping Curves</a> rules are used to determine 
		the edges of the rectangle. 
		This shape results in a vertical edge 
		25% from the left side of the reference box.</p>
<pre><code>shape-outside: inset(0% 150% 50% 0%);
</code></pre>
    <p>If the shape is only a horizontal line,
		then it is an empty float area and has no effect on wrapping. 
		Note that in this example shape-margin must be 0px 
		(otherwise the line would expand to enclose an area).</p>
<pre><code>shape-outside: inset(50% 0% 0% 50%);
shape-margin: 0px;
</code></pre>
   </div>
   <div class="example" id="example-105c1362">
    <a class="self-link" href="#example-105c1362"></a> 
    <p>A <a class="property" data-link-type="propdesc" href="#propdef-shape-outside" id="ref-for-propdef-shape-outside⑤">shape-outside</a> can create open areas
		on both the left and right
		of a <a data-link-type="dfn" href="#float-area" id="ref-for-float-area①⑥">float area</a>.
		Content still <a data-link-type="dfn" href="#wrap" id="ref-for-wrap①①">wraps</a> only on one side
		of a float in this case.
		In the picture,
		the shape is rendered in blue,
		and the content area outside the shape in mauve.</p>
<pre><code>shape-outside: polygon(50px 0px, 100px 100px, 0px 100px);
</code></pre>
    <p><img alt="wrapping around right side of a left-float float area" class="singleImgExample" src="images/float-side-example.png"></p>
   </div>
   <div class="example" id="example-8937ace2">
    <a class="self-link" href="#example-8937ace2"></a> 
    <p>The following styling creates
		a shape much smaller than
		the float’s content area,
		and adds a margin-top to the float.
		In the picture,
		the shape is rendered in blue,
		the content area outside the shape in mauve,
		and the margin area of the float box in yellow.
		The inline content only <a data-link-type="dfn" href="#wrap" id="ref-for-wrap①②">wraps</a> around the shape,
		and otherwise overlays the rest
		of the float margin box.</p>
<pre><code>.float-left {
  shape-outside: polygon(0% 50%, 50% 100%, 0 100%);
  float: left;
  width: 100px;
  height: 100px;
  margin-top: 20px;
}
</code></pre>
    <p><img alt="Adding margin-top to a float with a small shape-outside" class="singleImgExample" src="images/float-margin-example.png"></p>
    <p>The next picture shows a possible result
		if two of these floats
		were stacked next to each other.
		Note that the floats are positioned
		using their margin boxes,
		not the <a data-link-type="dfn" href="#float-area" id="ref-for-float-area①⑦">float area</a>.</p>
    <p><img alt="Stacking two floats with a small shape-outside" class="singleImgExample" src="images/stacked-float-example.png"></p>
   </div>
   <h2 class="heading settled" data-level="3" id="basic-shape-functions"><span class="secno">3. </span><span class="content"> Basic Shapes</span><a class="self-link" href="#basic-shape-functions"></a></h2>
   <p>The <dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-basic-shape">&lt;basic-shape></dfn> type
	can be specified using basic shape functions.
	When using this syntax
	to define shapes,
	the <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="reference-box">reference box</dfn> is defined
	by each property that uses <a class="production css" data-link-type="type" href="#typedef-basic-shape" id="ref-for-typedef-basic-shape">&lt;basic-shape></a> values.
	The coordinate system for the shape
	has its origin on the top-left corner of the <a data-link-type="dfn" href="#reference-box" id="ref-for-reference-box">reference box</a> with the x-axis
	running to the right
	and the y-axis running downwards.
	All the lengths expressed in percentages
	are resolved from the used dimensions
	of the <span id="ref-for-reference-box①">reference box</span>.</p>
   <h3 class="heading settled" data-level="3.1" id="supported-basic-shapes"><span class="secno">3.1. </span><span class="content"> Supported Shapes</span><a class="self-link" href="#supported-basic-shapes"></a></h3>
   <p>The following shapes are supported.
	All <a class="production css" data-link-type="type" href="#typedef-basic-shape" id="ref-for-typedef-basic-shape①">&lt;basic-shape></a> values use <a href="https://www.w3.org/TR/css3-values/#functional-notation">functional notation</a> and are defined here using the <a href="https://www.w3.org/TR/css3-values/#value-defs">Value Definition Syntax</a>.</p>
   <dl>
    <dt><dfn class="dfn-paneled css" data-dfn-type="function" data-export id="funcdef-inset">inset()</dfn> =
			inset( <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage">&lt;length-percentage></a>{1,4} [ round <a class="production" data-link-type="propdesc" href="https://drafts.csswg.org/css-backgrounds-3/#propdef-border-radius" id="ref-for-propdef-border-radius">&lt;'border-radius'></a> ]? ) 
    <dd>
      Defines an inset rectangle. 
     <ul>
      <li> When all of the first four arguments
					are supplied they represent the <strong>top, right, bottom</strong> and <strong>left</strong> offsets
					from the <a data-link-type="dfn" href="#reference-box" id="ref-for-reference-box②">reference box</a> inward
					that define the positions
					of the edges
					of the inset rectangle.
					These arguments follow the syntax
					of the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/box.html#propdef-margin" id="ref-for-propdef-margin">margin</a> shorthand,
					that let you set all four insets
					with one, two or four values. 
      <li> The optional <a class="production" data-link-type="propdesc" href="https://drafts.csswg.org/css-backgrounds-3/#propdef-border-radius" id="ref-for-propdef-border-radius①">&lt;'border-radius'></a> argument(s)
					define rounded corners for the inset rectangle
					using the <span class="property" id="ref-for-propdef-border-radius②">border-radius</span> shorthand syntax. 
     </ul>
     <p>A pair of insets in either dimension
			that add up to more than the used dimension
			(such as left and right insets of 75% apiece)
			use the <a href="https://www.w3.org/TR/css3-background/#corner-overlap">CSS Backgrounds 3 §5.5 Overlapping Curves</a> rules 
			to proportionally reduce the inset effect to 100%. 
			This will result in a shape edge positioned 
			within the reference box 
			(at 50%, in the case of two 75% inset values).</p>
    <dt><dfn class="dfn-paneled css" data-dfn-type="function" data-export id="funcdef-circle">circle()</dfn> =
			circle( <a class="production css" data-link-type="type" href="#typedef-shape-radius" id="ref-for-typedef-shape-radius">&lt;shape-radius></a>? [ at <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-position" id="ref-for-typedef-position">&lt;position></a> ]? ) 
    <dd>
     <ul>
      <li> The shape-radius argument represents <strong>r</strong>, the radius
					of the circle.
					Negative values are invalid.
					A percentage value here
					is resolved from the used width and height
					of the <a data-link-type="dfn" href="#reference-box" id="ref-for-reference-box③">reference box</a> as <br> <code>sqrt(<em>width</em><sup>2</sup>+<em>height</em><sup>2</sup>)/sqrt(2)</code>. 
      <li> The position argument defines
					the center of the circle.
					This defaults to center if omitted. 
     </ul>
    <dt><dfn class="dfn-paneled css" data-dfn-type="function" data-export id="funcdef-ellipse">ellipse()</dfn> =
			ellipse( [ <a class="production css" data-link-type="type" href="#typedef-shape-radius" id="ref-for-typedef-shape-radius①">&lt;shape-radius></a>{2} ]? [ at <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-position" id="ref-for-typedef-position①">&lt;position></a> ]? ) 
    <dd>
     <ul>
      <li> The shape-radius arguments represent <strong>rx</strong> and <strong>ry</strong>,
					the x-axis and y-axis radii
					of the ellipse,
					in that order.
					Negative values for either radius are invalid.
					Percentage values here are resolved
					against the used width (for the rx value)
					and the used height (for the ry value)
					of the reference box. 
      <li> The position argument defines
					the center of the ellipse.
					This defaults to center if omitted. 
     </ul>
    <dt><dfn class="dfn-paneled css" data-dfn-type="function" data-export id="funcdef-polygon">polygon()</dfn> =
			polygon( <a class="production" data-link-type="propdesc" href="https://svgwg.org/svg2-draft/painting.html#FillRuleProperty" id="ref-for-FillRuleProperty">&lt;'fill-rule'></a>? , [<a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage①">&lt;length-percentage></a> <span class="production" id="ref-for-typedef-length-percentage②">&lt;length-percentage></span>]# ) 
    <dd>
     <ul>
      <li> <a class="production" data-link-type="propdesc" href="https://svgwg.org/svg2-draft/painting.html#FillRuleProperty" id="ref-for-FillRuleProperty①">&lt;'fill-rule'></a> -
					The filling rule used
					to determine the interior
					of the polygon.
					See <a href="https://www.w3.org/TR/SVG/painting.html#FillRuleProperty">fill-rule</a> property
					in SVG for details.
					Possible values are <a class="css" data-link-type="maybe" href="https://drafts.fxtf.org/css-masking-1/#valdef-clip-rule-nonzero" id="ref-for-valdef-clip-rule-nonzero">nonzero</a> or <a class="css" data-link-type="maybe" href="https://drafts.fxtf.org/css-masking-1/#valdef-clip-rule-evenodd" id="ref-for-valdef-clip-rule-evenodd">evenodd</a>.
					Default value when omitted is <span class="css" id="ref-for-valdef-clip-rule-nonzero①">nonzero</span>.
      <li> Each pair argument in the list represents <strong>x<sub>i</sub></strong> and <strong>y<sub>i</sub></strong> -
					the <strong>x</strong> and <strong>y</strong> axis coordinates of the i-th vertex of the polygon. 
     </ul>
     <p>The UA must close a polygon
			by connecting the last vertex
			with the first vertex of the list.</p>
    <dt><dfn class="css" data-dfn-type="function" data-export id="funcdef-path">path()<a class="self-link" href="#funcdef-path"></a></dfn> = 
			path( [<a class="production" data-link-type="propdesc" href="https://svgwg.org/svg2-draft/painting.html#FillRuleProperty" id="ref-for-FillRuleProperty②">&lt;'fill-rule'></a>,]? <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#string-value" id="ref-for-string-value">&lt;string></a> ) 
    <dd>
     <ul>
      <li> <a class="production" data-link-type="propdesc" href="https://svgwg.org/svg2-draft/painting.html#FillRuleProperty" id="ref-for-FillRuleProperty③">&lt;'fill-rule'></a> -
					The filling rule used
					to determine the interior
					of the path.
					See <a href="https://www.w3.org/TR/SVG/painting.html#FillRuleProperty">fill-rule</a> property
					in SVG for details.
					Possible values are <a class="css" data-link-type="maybe" href="https://drafts.fxtf.org/css-masking-1/#valdef-clip-rule-nonzero" id="ref-for-valdef-clip-rule-nonzero②">nonzero</a> or <a class="css" data-link-type="maybe" href="https://drafts.fxtf.org/css-masking-1/#valdef-clip-rule-evenodd" id="ref-for-valdef-clip-rule-evenodd①">evenodd</a>.
					Default value when omitted is <span class="css" id="ref-for-valdef-clip-rule-nonzero③">nonzero</span>. 
      <li> The <dfn class="css" data-dfn-for="path()" data-dfn-type="value" data-export id="valdef-path-string"><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#string-value" id="ref-for-string-value①">&lt;string></a><a class="self-link" href="#valdef-path-string"></a></dfn> represents an <a href="https://www.w3.org/TR/SVG11/paths.html#PathData">SVG Path data string</a>.
					The path data string must be conform
					to the grammar and parsing rules of SVG 1.1.
					The initial position is defined
					by the first “move to” argument
					in the path string.
					For the initial direction follow SVG 1.1. 
     </ul>
     <p>The UA must close a path
			with an implicit 
			closepath command ("z" or "Z") 
			if it is not present in the string 
			for properties that require a closed loop 
			(such as <a class="property" data-link-type="propdesc" href="#propdef-shape-outside" id="ref-for-propdef-shape-outside⑥">shape-outside</a> and <a class="property" data-link-type="propdesc" href="https://drafts.fxtf.org/css-masking-1/#propdef-clip-path" id="ref-for-propdef-clip-path">clip-path</a>).</p>
   </dl>
   <p>The arguments not defined above are defined as follows:</p>
   <dl>
    <dt><dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-shape-radius"><a class="production css" data-link-type="type" href="#typedef-shape-radius" id="ref-for-typedef-shape-radius②">&lt;shape-radius></a></dfn> = <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage③">&lt;length-percentage></a> | closest-side | farthest-side 
    <dd>
      Defines a radius for a circle or ellipse. If omitted it defaults to closest-side. 
     <ul>
      <li> <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="closest-side">closest-side</dfn> uses the length from the center
					of the shape to the closest side
					of the <a data-link-type="dfn" href="#reference-box" id="ref-for-reference-box④">reference box</a>.
					For circles,
					this is the closest side
					in any dimension.
					For ellipses,
					this is the closest side
					in the radius dimension. 
      <li> <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="farthest-side">farthest-side</dfn> uses the length from the center
					of the shape to the farthest side
					of the <a data-link-type="dfn" href="#reference-box" id="ref-for-reference-box⑤">reference box</a>.
					For circles,
					this is the farthest side
					in any dimension.
					For ellipses,
					this is the farthest side
					in the radius dimension. 
     </ul>
   </dl>
   <h3 class="heading settled" data-level="3.2" id="basic-shape-computed-values"><span class="secno">3.2. </span><span class="content"> Computed Values of Basic Shapes</span><a class="self-link" href="#basic-shape-computed-values"></a></h3>
   <p>The values in a <a class="production css" data-link-type="type" href="#typedef-basic-shape" id="ref-for-typedef-basic-shape②">&lt;basic-shape></a> function are computed as specified, with these exceptions:</p>
   <ul>
    <li> Omitted values are included and compute to their defaults. 
    <li> A <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-position" id="ref-for-typedef-position②">&lt;position></a> value in <a class="css" data-link-type="maybe" href="#funcdef-circle" id="ref-for-funcdef-circle">circle()</a> or <a class="css" data-link-type="maybe" href="#funcdef-ellipse" id="ref-for-funcdef-ellipse">ellipse()</a> is computed as a pair of offsets (horizontal then vertical) from the top left origin, each given as a combination of an absolute length and a percentage. 
    <li> A <a class="production" data-link-type="propdesc" href="https://drafts.csswg.org/css-backgrounds-3/#propdef-border-radius" id="ref-for-propdef-border-radius③">&lt;'border-radius'></a> value in <a class="css" data-link-type="maybe" href="#funcdef-inset" id="ref-for-funcdef-inset">inset()</a> is computed as an expanded list of all eight <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage④">&lt;length-percentage></a> values. 
   </ul>
   <h3 class="heading settled" data-level="3.3" id="basic-shape-serialization"><span class="secno">3.3. </span><span class="content"> Serialization of Basic Shapes</span><a class="self-link" href="#basic-shape-serialization"></a></h3>
   <p>To serialize the <a class="production css" data-link-type="type" href="#typedef-basic-shape" id="ref-for-typedef-basic-shape③">&lt;basic-shape></a> functions,
	serialize as per their individual grammars,
	in the order the grammars are written in,
	avoiding calc() expressions where possible,
	avoiding calc() transformations,
	omitting components when possible without changing the meaning,
	joining space-separated tokens with a single space,
	and following each serialized comma with a single space.</p>
   <div class="example" id="example-6083e402">
    <a class="self-link" href="#example-6083e402"></a> 
    <p>Since <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-position" id="ref-for-typedef-position③">&lt;position></a> keywords stand in for percentages, keywords without an offset turn into percentages.</p>
<pre><code>circle(at left bottom)

serializes as "circle(at 0% 100%)"
</code></pre>
    <p>Omitting components means that some default values do not show up in the serialization. But since <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-position" id="ref-for-typedef-position④">&lt;position></a> always uses the 2- or 4-value form, a default <span class="production" id="ref-for-typedef-position⑤">&lt;position></span> is not omitted.</p>
<pre><code>circle(closest-side at center)

serializes as "circle(at 50% 50%)"
</code></pre>
    <p>Using grammar order means that <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-position" id="ref-for-typedef-position⑥">&lt;position></a> values always give horizontal components first, then vertical.</p>
<pre><code>circle(at bottom left)

serializes as "circle(at 0% 100%)"
</code></pre>
    <p>Avoiding calc() expressions means that some <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-position" id="ref-for-typedef-position⑦">&lt;position></a> values that could be simplified to the 2-value form must be serialized in 4-value form instead.</p>
<pre><code>circle(at right 5px bottom 10px)

serializes as "circle(at right 5px bottom 10px)"

not as "circle(at calc(100% - 5px) calc(100% - 10px))"
</code></pre>
    <p>Avoiding calc() transformations means that if a specified (or computed) calc() must stay in calc() form, it will be used as-is, not reformulated with a different origin or reduced.</p>
<pre><code>bottom calc(10% + 5px)

serializes as "bottom calc(10% + 5px)"

not as "top calc(90% - 5px)" or "calc(90% - 5px)"
</code></pre>
    <p>Preferring 0% over a zero length comes up when you must supply an omitted offset.</p>
<pre><code>circle(at right 5px top)

serializes as "circle(at right 5px top 0%)"
</code></pre>
    <p>Preferring left and top origins means that some percentage offsets will normalize to those origins (when calc can be avoided).</p>
<pre><code>circle(at right 5% top 0px)

serializes as "circle(at 95% 0%)"
</code></pre>
   </div>
   <h3 class="heading settled" data-level="3.4" id="basic-shape-interpolation"><span class="secno">3.4. </span><span class="content"> Interpolation of Basic Shapes</span><a class="self-link" href="#basic-shape-interpolation"></a></h3>
   <p>For interpolating between
	one basic shape and a second,
	the rules below are applied.
	The values in the shape functions interpolate
	as a <a href="https://www.w3.org/TR/css3-transitions/#animtype-simple-list">simple list</a>.
	The list values interpolate as <a href="https://www.w3.org/TR/css3-transitions/#animtype-lpcalc">length,
	percentage, or calc</a> where possible.
	If list values are not one of those types
	but are identical
	(such as finding <a class="css" data-link-type="maybe" href="https://drafts.fxtf.org/css-masking-1/#valdef-clip-rule-nonzero" id="ref-for-valdef-clip-rule-nonzero④">nonzero</a> in the same list position
	in both lists)
	those values do interpolate.</p>
   <ul>
    <li> Both shapes must use the same <a data-link-type="dfn" href="#reference-box" id="ref-for-reference-box⑥">reference box</a>. 
    <li> If both shapes are the same type,
			that type is <a class="css" data-link-type="maybe" href="#funcdef-ellipse" id="ref-for-funcdef-ellipse①">ellipse()</a> or <a class="css" data-link-type="maybe" href="#funcdef-circle" id="ref-for-funcdef-circle①">circle()</a>,
			and none of the radii use
			the <a href="#closest-side" id="ref-for-closest-side"><span class="css">closest-side</span></a> or <a href="#farthest-side" id="ref-for-farthest-side"><span class="css">farthest-side</span></a> keywords,
			interpolate between each value
			in the shape functions. 
    <li> If both shapes are of type <a class="css" data-link-type="maybe" href="#funcdef-inset" id="ref-for-funcdef-inset①">inset()</a>,
			interpolate between each value
			in the shape functions. 
    <li> If both shapes are of type <a class="css" data-link-type="maybe" href="#funcdef-polygon" id="ref-for-funcdef-polygon">polygon()</a>,
			both polygons have the same number of vertices,
			and use the same <a class="production" data-link-type="propdesc" href="https://svgwg.org/svg2-draft/painting.html#FillRuleProperty" id="ref-for-FillRuleProperty④">&lt;'fill-rule'></a>,
			interpolate between each value
			in the shape functions. 
    <li> In all other cases no interpolation is specified. 
   </ul>
   <h2 class="heading settled" data-level="4" id="shapes-from-image"><span class="secno">4. </span><span class="content"> Shapes from Image</span><a class="self-link" href="#shapes-from-image"></a></h2>
   <p>Another way of defining shapes
	is by specifying a source <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-images-3/#typedef-image" id="ref-for-typedef-image">&lt;image></a> whose alpha channel is used
	to compute the shape.
	The shape is computed to be the path or paths
	that enclose the area(s)
	where the opacity of the specified image
	is greater than the <a class="property" data-link-type="propdesc" href="#propdef-shape-image-threshold" id="ref-for-propdef-shape-image-threshold">shape-image-threshold</a> value.
	The absence of any pixels with an alpha value
	greater than the specified threshold
	results in an empty float area that will not affect wrapping.
	If the <span class="property" id="ref-for-propdef-shape-image-threshold①">shape-image-threshold</span> is not specified,
	the initial value to be considered is 0.0.</p>
   <p>The image is sized and positioned
	as if it were a replaced element
	whose specified width and height
	are the same as the element’s
	used content box size.</p>
   <p>For animated raster image formats (such as <a href="http://www.w3.org/Graphics/GIF/spec-gif89a.txt">GIF</a>),
	the first frame of the animation sequence is used.</p>
   <div class="example" id="example-12b6dfcf">
    <a class="self-link" href="#example-12b6dfcf"></a> 
    <p>An image is floating to the left of a paragraph.
	The image shows the 3D version of the
	CSS logo over a transparent background.
	The logo has a shadow using an alpha-channel.</p>
    <p>The image defines its <a data-link-type="dfn" href="#float-area" id="ref-for-float-area①⑧">float area</a> through the <a class="property" data-link-type="propdesc" href="#propdef-shape-outside" id="ref-for-propdef-shape-outside⑦">shape-outside</a> property.</p>
<pre><code>
  &lt;p>
    &lt;img id="CSSlogo" src="CSS-logo1s.png"/>
    blah blah blah blah...
  &lt;/p>

  &lt;style>
    #CSSlogo {
      float: left;
      shape-outside: attr(src url);
      shape-image-threshold: 0.1;
    }
  &lt;/style>
</code></pre>
    <p>The <a class="property" data-link-type="propdesc" href="#propdef-shape-outside" id="ref-for-propdef-shape-outside⑧">shape-outside</a> property re-uses the url
	from the src attribute of the img element.</p>
    <p>It is perfectly possible to display an image
	and use a different image for its <a data-link-type="dfn" href="#float-area" id="ref-for-float-area①⑨">float area</a>.</p>
    <p>In the figure below, the alpha-channel threshold
	is represented by the dotted line around the CSS logo.</p>
    <p>It’s then possible to affect where the lines
	of the paragraph start in three ways:</p>
    <ol>
     <li>Modifying the alpha channel in the image
     <li>Changing the value of the <a class="property" data-link-type="propdesc" href="#propdef-shape-image-threshold" id="ref-for-propdef-shape-image-threshold②">shape-image-threshold</a> property
     <li>Changing the value of the <a class="property" data-link-type="propdesc" href="#propdef-shape-margin" id="ref-for-propdef-shape-margin">shape-margin</a> property (see example 8)
    </ol>
    <figure>
      <img alt="A float shape around an image using its alpha-channel" src="images/shape-outside-image.png" style="width:70%"> 
     <figcaption> A float shape around an image using its alpha-channel. </figcaption>
    </figure>
   </div>
   <h2 class="heading settled" data-level="5" id="shapes-from-box-values"><span class="secno">5. </span><span class="content"> Shapes from Box Values</span><a class="self-link" href="#shapes-from-box-values"></a></h2>
   <p>Shapes can be defined
	by reference to edges in the <a href="https://www.w3.org/TR/css-box-3/#the-css-box-model">CSS Box Model</a>.
	These edges include <a href="https://www.w3.org/TR/css3-background/#corner-shaping">border-radius curvature</a> <a data-link-type="biblio" href="#biblio-css3bg">[CSS3BG]</a> from the used border-radius values.
	The <a class="production css" data-link-type="type" href="#typedef-shape-box" id="ref-for-typedef-shape-box" title="Expands to: border-box | content-box | margin-box | padding-box">&lt;shape-box></a> value extends the <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-backgrounds-3/#typedef-box" id="ref-for-typedef-box">&lt;box></a> value
	to include <a class="css" data-link-type="maybe" href="#valdef-shape-box-margin-box" id="ref-for-valdef-shape-box-margin-box①">margin-box</a>.
	Its syntax is:</p>
<pre><dfn class="dfn-paneled" data-dfn-type="type" data-export id="typedef-shape-box"><a class="production" data-link-type="type" href="#typedef-shape-box" id="ref-for-typedef-shape-box①" title="Expands to: border-box | content-box | margin-box | padding-box">&lt;shape-box></a></dfn> = <a class="production" data-link-type="type" href="https://drafts.csswg.org/css-backgrounds-3/#typedef-box" id="ref-for-typedef-box①">&lt;box></a> | <a class="css" data-link-type="maybe" href="#valdef-shape-box-margin-box" id="ref-for-valdef-shape-box-margin-box②">margin-box</a>
</pre>
   <p>The definitions of the values are:</p>
   <p>The <dfn class="dfn-paneled css" data-dfn-for="<shape-box>, shape-outside" data-dfn-type="value" data-export id="valdef-shape-box-margin-box">margin-box</dfn> value defines the shape
	enclosed by the outside margin edge.
	The corner radii of this shape are determined
	by the corresponding border-radius and margin values.
	If the ratio of <code>border-radius/margin</code> is 1 or more, 
	or margin is negative or zero, 
	then the margin box corner radius is <code>max(border-radius + margin, 0)</code>.
	If the ratio of <code>border-radius/margin</code> is less than 1,
	and margin is positive, 
	then the margin box corner radius is <code>border-radius + margin * (1 + (ratio-1)^3)</code>.</p>
   <p>The <dfn class="dfn-paneled css" data-dfn-for="<shape-box>, shape-outside" data-dfn-type="value" data-export id="valdef-shape-box-border-box">border-box</dfn> value defines the shape
	enclosed by the outside border edge.
	This shape follows all
	of the normal border radius shaping rules
	for the outside of the border.</p>
   <p>The <dfn class="dfn-paneled css" data-dfn-for="<shape-box>, shape-outside" data-dfn-type="value" data-export id="valdef-shape-box-padding-box">padding-box</dfn> value defines the shape
	enclosed by the outside padding edge.
	This shape follows all
	of the normal border radius shaping rules
	for the inside of the border.</p>
   <p>The <dfn class="dfn-paneled css" data-dfn-for="<shape-box>, shape-outside" data-dfn-type="value" data-export id="valdef-shape-box-content-box">content-box</dfn> value defines the shape
	enclosed by the outside content edge.
	Each corner radius of this box
	is the larger of 0
	or <code>border-radius - border-width - padding</code>.</p>
   <div class="example" id="example-3c169cbd">
    <a class="self-link" href="#example-3c169cbd"></a> 
    <p>Given the 100px square below with
		10px padding, border and margins,
		the box values define these shapes:</p>
    <ul>
     <li><a class="css" data-link-type="maybe" href="#valdef-shape-box-margin-box" id="ref-for-valdef-shape-box-margin-box③">margin-box</a>: the shape containing all of the yellow pixels
     <li><a class="css" data-link-type="maybe" href="#valdef-shape-box-border-box" id="ref-for-valdef-shape-box-border-box">border-box</a>: the shape containing all of the black pixels
     <li><a class="css" data-link-type="maybe" href="#valdef-shape-box-padding-box" id="ref-for-valdef-shape-box-padding-box">padding-box</a>: the shape containing all of the mauve pixels
     <li><a class="css" data-link-type="maybe" href="#valdef-shape-box-content-box" id="ref-for-valdef-shape-box-content-box">content-box</a>: the shape containing all of the blue pixels
    </ul>
    <figure>
      <img alt="Colored boxes representing simple box edges" src="images/box-edges-simple.png"> 
     <figcaption> Simple CSS Box Model Edges </figcaption>
    </figure>
    <p>And the same definitions apply to a more complex example with the same 100px square, but with these border, padding and margin properties:</p>
<pre><code>
  border-radius: 20px 20px 20px 40px;
  border-width: 30px 10px 20px 10px;
  padding: 10px 20px 10px 10px;
  margin: 20px 10px 10px 10px;
</code></pre>
    <figure>
      <img alt="Colored boxes representing complex box edges" src="images/box-edges-complex.png"> 
     <figcaption> Complex CSS Box Model Edges </figcaption>
    </figure>
   </div>
   <div class="example" id="example-ae456cb1">
    <a class="self-link" href="#example-ae456cb1"></a> 
    <p>The difference between normal float wrapping
		and wrapping around the shape defined
		by the margin-box value is that
		the margin-box shape includes corner shaping.
		Take the 100px square with 10px padding,
		border and margins,
		but with a border-radius of 60px.
		If you make a left float out of it,
		content normally wraps in this manner:</p>
    <figure>
      <img alt="Text wrapping around float with no shape" src="images/normal-wrap.png"> 
     <figcaption> Normal float wrapping </figcaption>
    </figure>
    <p>If you add a margin-box shape to the float,
		then content wraps around the rounded margin-box corners.</p>
<pre><code>
  shape-outside: margin-box;
</code></pre>
    <figure>
      <img alt="Text wrapping around float with margin-box shape" src="images/margin-box-wrap.png"> 
     <figcaption> Float wrapping with margin-box </figcaption>
    </figure>
   </div>
   <h2 class="heading settled" data-level="6" id="declaring-shapes"><span class="secno">6. </span><span class="content"> Declaring Shapes</span><a class="self-link" href="#declaring-shapes"></a></h2>
   <p>Shapes are declared with
	the <a class="property" data-link-type="propdesc" href="#propdef-shape-outside" id="ref-for-propdef-shape-outside⑨">shape-outside</a> property,
	with possible modifications
	from the <a class="property" data-link-type="propdesc" href="#propdef-shape-margin" id="ref-for-propdef-shape-margin①">shape-margin</a> property.
	The shape defined by
	the <span class="property" id="ref-for-propdef-shape-outside①⓪">shape-outside</span> and <span class="property" id="ref-for-propdef-shape-margin②">shape-margin</span> properties
	changes the geometry
	of a float element’s <a data-link-type="dfn" href="#float-area" id="ref-for-float-area②⓪">float area</a>.</p>
   <h3 class="heading settled" data-level="6.1" id="shape-outside-property"><span class="secno">6.1. </span><span class="content"> Float Area Shape: the <a class="property" data-link-type="propdesc" href="#propdef-shape-outside" id="ref-for-propdef-shape-outside①①">shape-outside</a> property</span><a class="self-link" href="#shape-outside-property"></a></h3>
   <table class="def propdef" data-link-for-hint="shape-outside">
    <tbody>
     <tr>
      <th>Name:
      <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-shape-outside">shape-outside</dfn>
     <tr class="value">
      <th><a href="https://drafts.csswg.org/css-values/#value-defs">Value:</a>
      <td class="prod">none <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one">|</a> [ <a class="production css" data-link-type="type" href="#typedef-basic-shape" id="ref-for-typedef-basic-shape④">&lt;basic-shape></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-any" id="ref-for-comb-any">||</a> <a class="production css" data-link-type="type" href="#typedef-shape-box" id="ref-for-typedef-shape-box②" title="Expands to: border-box | content-box | margin-box | padding-box">&lt;shape-box></a> ] <span id="ref-for-comb-one①">|</span> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-images-3/#typedef-image" id="ref-for-typedef-image①">&lt;image></a> 
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#initial-values">Initial:</a>
      <td>none 
     <tr>
      <th>Applies to:
      <td>floats 
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#inherited-property">Inherited:</a>
      <td>no 
     <tr>
      <th><a href="https://drafts.csswg.org/css-values/#percentages">Percentages:</a>
      <td>n/a 
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#computed">Computed value:</a>
      <td>as <a href="#basic-shape-computed-values">defined</a> for <a class="production css" data-link-type="type" href="#typedef-basic-shape" id="ref-for-typedef-basic-shape⑤">&lt;basic-shape></a> (with <a class="production css" data-link-type="type" href="#typedef-shape-box" id="ref-for-typedef-shape-box③" title="Expands to: border-box | content-box | margin-box | padding-box">&lt;shape-box></a> following, if supplied); else the computed <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-images-3/#typedef-image" id="ref-for-typedef-image②">&lt;image></a>; else the keyword as specified 
     <tr>
      <th>Canonical order:
      <td>per grammar 
     <tr>
      <th><a href="https://drafts.csswg.org/web-animations/#animation-type">Animation type:</a>
      <td>as <a href="#basic-shape-interpolation">defined</a> for <a class="production css" data-link-type="type" href="#typedef-basic-shape" id="ref-for-typedef-basic-shape⑥">&lt;basic-shape></a>, otherwise discrete 
   </table>
   <p>The values of this property have the following meanings:</p>
   <dl>
    <dt><dfn class="dfn-paneled css" data-dfn-for="shape-outside" data-dfn-type="value" data-export id="valdef-shape-outside-none">none</dfn>
    <dd> The <a data-link-type="dfn" href="#float-area" id="ref-for-float-area②①">float area</a> is unaffected. 
    <dt><a class="production css" data-link-type="type" href="#typedef-shape-box" id="ref-for-typedef-shape-box④" title="Expands to: border-box | content-box | margin-box | padding-box">&lt;shape-box></a>
    <dd> If one of these values is specified by itself
			the shape is computed based on one of <a class="css" data-link-type="maybe" href="#valdef-shape-box-margin-box" id="ref-for-valdef-shape-box-margin-box④">margin-box</a>, <a class="css" data-link-type="maybe" href="#valdef-shape-box-border-box" id="ref-for-valdef-shape-box-border-box①">border-box</a>, <a class="css" data-link-type="maybe" href="#valdef-shape-box-padding-box" id="ref-for-valdef-shape-box-padding-box①">padding-box</a> or <a class="css" data-link-type="maybe" href="#valdef-shape-box-content-box" id="ref-for-valdef-shape-box-content-box①">content-box</a> which use their respective boxes
			including curvature from border-radius,
			similar to <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-backgrounds-3/#propdef-background-clip" id="ref-for-propdef-background-clip">background-clip</a> <a data-link-type="biblio" href="#biblio-css3bg">[CSS3BG]</a>. 
    <dt><dfn class="css" data-dfn-for="shape-outside" data-dfn-type="value" data-export id="valdef-shape-outside-basic-shape"><a class="production css" data-link-type="type" href="#typedef-basic-shape" id="ref-for-typedef-basic-shape⑦">&lt;basic-shape></a><a class="self-link" href="#valdef-shape-outside-basic-shape"></a></dfn>
    <dd> The shape is computed based on the values of one
			of <a class="css" data-link-type="maybe" href="#funcdef-inset" id="ref-for-funcdef-inset②">inset()</a>, <a class="css" data-link-type="maybe" href="#funcdef-circle" id="ref-for-funcdef-circle②">circle()</a>, <a class="css" data-link-type="maybe" href="#funcdef-ellipse" id="ref-for-funcdef-ellipse②">ellipse()</a> or <a class="css" data-link-type="maybe" href="#funcdef-polygon" id="ref-for-funcdef-polygon①">polygon()</a>. If a <a class="production css" data-link-type="type" href="#typedef-shape-box" id="ref-for-typedef-shape-box⑤" title="Expands to: border-box | content-box | margin-box | padding-box">&lt;shape-box></a> is also supplied, this defines the <a data-link-type="dfn" href="#reference-box" id="ref-for-reference-box⑦">reference box</a> for the <a class="production css" data-link-type="type" href="#typedef-basic-shape" id="ref-for-typedef-basic-shape⑧">&lt;basic-shape></a> function. If <span class="production" id="ref-for-typedef-shape-box⑥" title="Expands to: border-box | content-box | margin-box | padding-box">&lt;shape-box></span> is not supplied, then the <span id="ref-for-reference-box⑧">reference box</span> defaults to <a class="css" data-link-type="maybe" href="#valdef-shape-box-margin-box" id="ref-for-valdef-shape-box-margin-box⑤">margin-box</a>. 
    <dt><dfn class="css" data-dfn-for="shape-outside" data-dfn-type="value" data-export id="valdef-shape-outside-image"><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-images-3/#typedef-image" id="ref-for-typedef-image③">&lt;image></a><a class="self-link" href="#valdef-shape-outside-image"></a></dfn>
    <dd>
      The shape is extracted
			and computed based
			on the alpha channel
			of the specified <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-images-3/#typedef-image" id="ref-for-typedef-image④">&lt;image></a> as defined by <a class="property" data-link-type="propdesc" href="#propdef-shape-image-threshold" id="ref-for-propdef-shape-image-threshold③">shape-image-threshold</a>. 
     <p>User agents must use the <a href="https://www.w3.org/TR/html5/infrastructure.html#cors-enabled-fetch">potentially CORS-enabled fetch</a> method defined by the <a data-link-type="biblio" href="#biblio-html5">[HTML5]</a> specification
			for all URLs in a <a class="property" data-link-type="propdesc" href="#propdef-shape-outside" id="ref-for-propdef-shape-outside①②">shape-outside</a> value.
			When fetching,
			user agents must use "Anonymous" mode,
			set the referrer source
			to the stylesheet’s URL
			and set the origin to the URL
			of the containing document.
			If this results in network errors
			such that there is no valid fallback image,
			the effect is as if
			the value <a class="css" data-link-type="value" href="#valdef-shape-outside-none" id="ref-for-valdef-shape-outside-none">none</a> had been specified.</p>
   </dl>
   <h3 class="heading settled" data-level="6.2" id="shape-image-threshold-property"><span class="secno">6.2. </span><span class="content"> Choosing Image Pixels: the <a class="property" data-link-type="propdesc" href="#propdef-shape-image-threshold" id="ref-for-propdef-shape-image-threshold④">shape-image-threshold</a> property</span><a class="self-link" href="#shape-image-threshold-property"></a></h3>
   <p>The <a class="property" data-link-type="propdesc" href="#propdef-shape-image-threshold" id="ref-for-propdef-shape-image-threshold⑤">shape-image-threshold</a> defines the alpha channel threshold
	used to extract the shape
	using an image.
	A value of 0.5 means that
	the shape will enclose
	all the pixels
	that are more than 50% opaque.</p>
   <table class="def propdef" data-link-for-hint="shape-image-threshold">
    <tbody>
     <tr>
      <th>Name:
      <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-shape-image-threshold">shape-image-threshold</dfn>
     <tr class="value">
      <th><a href="https://drafts.csswg.org/css-values/#value-defs">Value:</a>
      <td class="prod"><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-color-4/#typedef-alpha-value" id="ref-for-typedef-alpha-value">&lt;alpha-value></a> 
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#initial-values">Initial:</a>
      <td>0 
     <tr>
      <th>Applies to:
      <td>floats 
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#inherited-property">Inherited:</a>
      <td>no 
     <tr>
      <th><a href="https://drafts.csswg.org/css-values/#percentages">Percentages:</a>
      <td>n/a 
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#computed">Computed value:</a>
      <td>specified number, clamped to the range [0,1] 
     <tr>
      <th>Canonical order:
      <td>per grammar 
     <tr>
      <th><a href="https://drafts.csswg.org/web-animations/#animation-type">Animation type:</a>
      <td>by computed value 
   </table>
   <p>The values of this property have the following meanings:</p>
   <dl>
    <dt><dfn class="css" data-dfn-for="shape-image-threshold" data-dfn-type="value" data-export id="valdef-shape-image-threshold-number"><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#number-value" id="ref-for-number-value">&lt;number></a><a class="self-link" href="#valdef-shape-image-threshold-number"></a></dfn>
    <dd> Sets the threshold used
			for extracting a shape
			from an image.
			The shape is defined
			by the pixels whose alpha value
			is greater than the threshold.
			A threshold value outside the range
			0.0 (fully transparent)
			to 1.0 (fully opaque)
			will be clamped to this range. 
   </dl>
   <p class="note" role="note"><span>Note:</span> A future level of CSS Shapes may define
	a switch to use the luminance data
	from an image instead of the alpha data.
	When this happens,
	shape-image-threshold will be extended
	to apply its threshold
	to either alpha or luminance,
	depending on the switch state.</p>
   <h3 class="heading settled" data-level="6.3" id="shape-margin-property"><span class="secno">6.3. </span><span class="content"> Expanding a Shape: the <a class="property" data-link-type="propdesc" href="#propdef-shape-margin" id="ref-for-propdef-shape-margin③">shape-margin</a> property</span><a class="self-link" href="#shape-margin-property"></a></h3>
   <p>The <a class="property" data-link-type="propdesc" href="#propdef-shape-margin" id="ref-for-propdef-shape-margin④">shape-margin</a> property adds
	a margin to a <a class="property" data-link-type="propdesc" href="#propdef-shape-outside" id="ref-for-propdef-shape-outside①③">shape-outside</a>.
	This defines a new shape
	that is the smallest contour
	(in the shrink-wrap sense)
	that includes all the points
	that are the <span class="property" id="ref-for-propdef-shape-margin⑤">shape-margin</span> distance outward
	in the perpendicular direction
	from a point on the underlying shape. 
	This includes any edge or line sections 
	from the underlying shape.
	Note that at points where
	a perpendicular is not defined
	(e.g. sharp points or line ends)
	take all points
	on the circle centered at the point
	and with a radius of <span class="property" id="ref-for-propdef-shape-margin⑥">shape-margin</span>.
	This property takes only non-negative values.</p>
   <table class="def propdef" data-link-for-hint="shape-margin">
    <tbody>
     <tr>
      <th>Name:
      <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-shape-margin">shape-margin</dfn>
     <tr class="value">
      <th><a href="https://drafts.csswg.org/css-values/#value-defs">Value:</a>
      <td class="prod"><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage⑤">&lt;length-percentage></a> 
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#initial-values">Initial:</a>
      <td>0 
     <tr>
      <th>Applies to:
      <td>floats 
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#inherited-property">Inherited:</a>
      <td>no 
     <tr>
      <th><a href="https://drafts.csswg.org/css-values/#percentages">Percentages:</a>
      <td>refer to the <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-4/#inline-size" id="ref-for-inline-size">inline size</a> of the containing block 
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#computed">Computed value:</a>
      <td>computed <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage⑥">&lt;length-percentage></a> value 
     <tr>
      <th>Canonical order:
      <td>per grammar 
     <tr>
      <th><a href="https://drafts.csswg.org/web-animations/#animation-type">Animation type:</a>
      <td>by computed value 
   </table>
   <dl>
    <dt><dfn class="css" data-dfn-for="shape-margin" data-dfn-type="value" data-export id="valdef-shape-margin-length-percentage"><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage⑦">&lt;length-percentage></a><a class="self-link" href="#valdef-shape-margin-length-percentage"></a></dfn>
    <dd> Sets the margin of the shape to the specified value. 
   </dl>
   <p class="note" role="note"><span>Note:</span> Adding a shape-margin does NOT allow a float area
	to extend outside a float’s margin box. 
	Extra margin may need to be applied 
	along with shape-margin to avoid clipping.</p>
   <div class="example" id="example-dde61751">
    <a class="self-link" href="#example-dde61751"></a> 
    <p>A <a class="property" data-link-type="propdesc" href="#propdef-shape-margin" id="ref-for-propdef-shape-margin⑦">shape-margin</a> creating an offset from a polygonal <a class="property" data-link-type="propdesc" href="#propdef-shape-outside" id="ref-for-propdef-shape-outside①④">shape-outside</a>.
		The lighter blue area shows the shape in a 100x100px float, 
		and the darker blue area shows the 10px offset.</p>
<pre><code>
  .float {
      width: 100px;
      height: 100px;
    shape-outside: polygon(10px 10px, 90px 50px, 40px 50px, 90px 90px, 10px 90px);
    shape-margin: 10px;
  }
</code></pre>
    <p><img alt="Example of a shape-margin offset" src="images/nepal-flag-shape.png"></p>
   </div>
   <div class="example" id="example-dc83070e">
    <a class="self-link" href="#example-dc83070e"></a> 
    <p>If shape-margin is added
		to the CSS logo from example 6,
		the line boxes <a data-link-type="dfn" href="#wrap" id="ref-for-wrap①③">wrapping</a> around the shape are shortened further.
		In case the image’s alpha channel 
		runs up to the right edge of the image, 
		some extra margin-right should be applied 
		to ensure the shape is not clipped by the margin box.</p>
<pre><code>
  #CSSlogo {
    shape-margin: 35px;
    margin-right: 35px;
  }
</code></pre>
    <figure>
      <img alt="A float shape around an image using its alpha-channel with a 35 pixels shape-margin" src="images/shape-outside-image-with-margin.png" style="width:70%"> 
     <figcaption> A float shape around an image using its alpha-channel with a 35-pixel <a class="property" data-link-type="propdesc" href="#propdef-shape-margin" id="ref-for-propdef-shape-margin⑧">shape-margin</a> </figcaption>
    </figure>
   </div>
   <h2 class="no-num heading settled" id="acknowledgments"><span class="content"> Acknowledgments</span><a class="self-link" href="#acknowledgments"></a></h2>
   <p>This specification is made possible by input from
    Tab Atkins Jr.,
	Amelia Bellamy-Royds,
	Andrei Bucur,
	Alexandru Chiculita,
	Boris Chiou,
	Emilio Cobos Álvarez,
	Elika Etemad,
	Arron Eicholz,
	Sylvain Galineau,
	Daniel Glazman,
	Arno Gourdol,
	Zoltan Horvath,
	Chris Jones,
	Bem Jones-Bey,
	Ian Kilpatrick,
	Ting-Yu Lin,
	Eric Meyer,
	Marcus Mielke,
	Alex Mogilevsky,
	Hans Muller,
	Mihnea Ovidenie,
	Virgil Palanciuc,
	Robert Sanderson,
	Dirk Schulze,
	Jen Simmons,
	Peter Sorotokin,
	Bear Travis,
	Eugene Veselov,
	Brad Werth,
	Stephen Zilles
	and the CSS Working Group members.</p>
   <h2 class="no-num heading settled" id="change-log"><span class="content"> Change Log</span><a class="self-link" href="#change-log"></a></h2>
   <h3 class="no-num heading settled" id="20140320"><span class="content"> Since <a href="https://www.w3.org/TR/2014/CR-css-shapes-1-20140320/">March 20th 2014</a></span><a class="self-link" href="#20140320"></a></h3>
   <ul>
    <li>Clarified shape-margin computed value
    <li>Clarified empty circles and ellipses for <a href="https://github.com/w3c/csswg-drafts/issues/850">issue #850</a>
    <li>Moved path() back from level 2
    <li>Added handling of negative margins for margin-box
    <li>Added clarifications to shape-margin examples
    <li>Added margin=0 case for margin-box shape
    <li>Changed rules about degenerate shapes to use shape edges
   </ul>
   <h3 class="no-num heading settled" id="20140211"><span class="content"> Since <a href="https://www.w3.org/TR/2014/WD-css-shapes-1-20140211/">February 11th 2014</a></span><a class="self-link" href="#20140211"></a></h3>
   <ul>
    <li>Replaced divs with images in the first example
    <li>Add 0px to last serialization example
   </ul>
   <h3 class="no-num heading settled" id="20131203"><span class="content"> Since <a href="https://www.w3.org/TR/2013/WD-css-shapes-1-20131203/">December 3rd 2013</a></span><a class="self-link" href="#20131203"></a></h3>
   <ul>
    <li>Updated computed value and serialization of basic shapes
    <li>Added a margin-box example
    <li>Change auto to none for shape-outside
    <li>Defined shape-box instead of redefining box
    <li>Clarified that shape from image may produce more than one path
   </ul>
   <h3 class="no-num heading settled" id="20130620"><span class="content"> Since <a href="https://www.w3.org/TR/2013/WD-css-shapes-1-20130620/">June 20th 2013</a></span><a class="self-link" href="#20130620"></a></h3>
   <ul>
    <li>Added shape from box value section
    <li>Updated basic-shape interpolation
    <li>Allow negative insets, disallow negative radii
    <li>Changed relevant to reference
    <li>Remove box-sizing dependency, add relevant box keywords
    <li>Changed circle() and ellipse() to use radial gradient syntax
    <li>Postponed rectangle() to level 2
    <li>Clarified shape-from-image sizing and positioning
    <li>Change inset-rectangle() to inset()
    <li>Future-proof shape-image-threshold to possibly apply to luminance
    <li>Added CORS fetching to shape-outside URLs
    <li>Changed shape-outside value from &lt;uri> to &lt;image>
    <li>Remove 'percentages based on auto-sizing resolve to 0'
    <li>Change initial value of shape-image-threshold to 0.0
    <li>Change float positioning to be unaffected by shape-outside
    <li>Shapes on floats clipped to float’s margin box
   </ul>
   <h3 class="no-num heading settled" id="20120503"><span class="content"> Since <a href="https://www.w3.org/TR/2012/WD-css3-exclusions-20120503/">May 3rd 2012</a></span><a class="self-link" href="#20120503"></a></h3>
   <ul>
    <li>Postpone shapes from SVG elements to a future Shapes level
    <li>Postpone shape-inside to a future Shapes level
    <li>split exclusions from shapes into separate modules
    <li>added inset-rectangle() to basic shapes
    <li>Changed shape-inside overflow diagrams to show exclusion behavior
    <li>Changed shape-inside to contribute to the wrapping context
    <li>Defined exclusion edges relative to wrapping content’s writing mode
    <li>Made use of start, end, before and after consistent
    <li>Added interpolation for basic shapes
    <li>Changed basic shapes to depend on box specified with box-sizing
    <li>Added overflow behavior for shape-inside.
    <li>Added wrap-flow:minimum.
    <li>Clarified processing model.
    <li>Changed wrap-margin and wrap-padding to shape-margin and shape-padding.
    <li>Removed wrap shorthand.
   </ul>
   <h3 class="no-num heading settled" id="20111213"><span class="content"> Since <a href="https://www.w3.org/TR/2011/WD-css3-exclusions-20111213/">December 13th 2011</a></span><a class="self-link" href="#20111213"></a></h3>
   <ul>
    <li>Clarified processing model.
    <li>Clarified interaction with floats.
    <li>Clarified that an exclusion element establishes a new block formatting context.
   </ul>
   <h2 class="heading settled" data-level="7" id="priv-sec"><span class="secno">7. </span><span class="content">Privacy and Security Considerations</span><a class="self-link" href="#priv-sec"></a></h2>
   <p>Since the <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-images-3/#typedef-image" id="ref-for-typedef-image⑤">&lt;image></a> value of <a class="property" data-link-type="propdesc" href="#propdef-shape-outside" id="ref-for-propdef-shape-outside①⑤">shape-outside</a> can expose some image data in a new way, 
	use is limited to images with CORS approval.</p>
  </main>
  <h2 class="no-ref no-num heading settled" id="conformance"><span class="content"> Conformance</span><a class="self-link" href="#conformance"></a></h2>
  <h3 class="heading settled" id="document-conventions"><span class="content"> Document conventions</span><a class="self-link" href="#document-conventions"></a></h3>
  <p>Conformance requirements are expressed with a combination of
	descriptive assertions and RFC 2119 terminology. The key words “MUST”,
	“MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”,
	“RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this
	document are to be interpreted as described in RFC 2119.
	However, for readability, these words do not appear in all uppercase
	letters in this specification. </p>
  <p>All of the text of this specification is normative except sections
	explicitly marked as non-normative, examples, and notes. <a data-link-type="biblio" href="#biblio-rfc2119">[RFC2119]</a> </p>
  <p>Examples in this specification are introduced with the words “for example”
	or are set apart from the normative text with <code>class="example"</code>,
	like this: </p>
  <div class="example" id="example-ae2b6bc0">
   <a class="self-link" href="#example-ae2b6bc0"></a> 
   <p>This is an example of an informative example. </p>
  </div>
  <p>Informative notes begin with the word “Note” and are set apart from the
	normative text with <code>class="note"</code>, like this: </p>
  <p class="note" role="note">Note, this is an informative note. </p>
  <p>Advisements are normative sections styled to evoke special attention and are
	set apart from other normative text with <code>&lt;strong class="advisement"></code>, like
	this: <strong class="advisement"> UAs MUST provide an accessible alternative. </strong> </p>
  <h3 class="heading settled" id="conform-classes"><span class="content"> Conformance classes</span><a class="self-link" href="#conform-classes"></a></h3>
  <p>Conformance to this specification
	is defined for three conformance classes: </p>
  <dl>
   <dt>style sheet 
   <dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#style-sheet">CSS
			style sheet</a>. 
   <dt>renderer 
   <dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#user-agent">UA</a> that interprets the semantics of a style sheet and renders
			documents that use them. 
   <dt>authoring tool 
   <dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#user-agent">UA</a> that writes a style sheet. 
  </dl>
  <p>A style sheet is conformant to this specification
	if all of its statements that use syntax defined in this module are valid
	according to the generic CSS grammar and the individual grammars of each
	feature defined in this module. </p>
  <p>A renderer is conformant to this specification
	if, in addition to interpreting the style sheet as defined by the
	appropriate specifications, it supports all the features defined
	by this specification by parsing them correctly
	and rendering the document accordingly. However, the inability of a
	UA to correctly render a document due to limitations of the device
	does not make the UA non-conformant. (For example, a UA is not
	required to render color on a monochrome monitor.) </p>
  <p>An authoring tool is conformant to this specification
	if it writes style sheets that are syntactically correct according to the
	generic CSS grammar and the individual grammars of each feature in
	this module, and meet all other conformance requirements of style sheets
	as described in this module. </p>
  <h3 class="heading settled" id="conform-responsible"><span class="content"> Requirements for Responsible Implementation of CSS</span><a class="self-link" href="#conform-responsible"></a></h3>
  <p>The following sections define several conformance requirements
		for implementing CSS responsibly,
		in a way that promotes interoperability in the present and future. </p>
  <h4 class="heading settled" id="conform-partial"><span class="content"> Partial Implementations</span><a class="self-link" href="#conform-partial"></a></h4>
  <p>So that authors can exploit the forward-compatible parsing rules to assign fallback values, <strong>CSS renderers <em>must</em> treat as invalid
		(and <a href="http://www.w3.org/TR/CSS2/conform.html#ignore">ignore as appropriate</a>)
		any at-rules, properties, property values, keywords, and other syntactic constructs
		for which they have no usable level of support</strong>.
		In particular, user agents <em>must not</em> selectively ignore
		unsupported property values and honor supported values in a single multi-value property declaration:
		if any value is considered invalid (as unsupported values must be),
		CSS requires that the entire declaration be ignored. </p>
  <h4 class="heading settled" id="conform-future-proofing"><span class="content"> Implementations of Unstable and Proprietary Features</span><a class="self-link" href="#conform-future-proofing"></a></h4>
  <p>To avoid clashes with future stable CSS features,
		the CSSWG recommends <a href="http://www.w3.org/TR/CSS/#future-proofing">following best practices</a> for the implementation of <a href="http://www.w3.org/TR/CSS/#unstable">unstable</a> features and <a href="http://www.w3.org/TR/CSS/#proprietary-extension">proprietary extensions</a> to CSS. </p>
  <h4 class="heading settled" id="conform-testing"><span class="content"> Implementations of CR-level Features</span><a class="self-link" href="#conform-testing"></a></h4>
  <p>Once a specification reaches the Candidate Recommendation stage,
		implementers should release an <a data-link-type="dfn" href="http://www.w3.org/TR/CSS/#vendor-prefix">unprefixed</a> implementation
		of any CR-level feature they can demonstrate
		to be correctly implemented according to spec,
		and should avoid exposing a prefixed variant of that feature. </p>
  <p>To establish and maintain the interoperability of CSS across
		implementations, the CSS Working Group requests that non-experimental
		CSS renderers submit an implementation report (and, if necessary, the
		testcases used for that implementation report) to the W3C before
		releasing an unprefixed implementation of any CSS features. Testcases
		submitted to W3C are subject to review and correction by the CSS
		Working Group. </p>
  <p>
   Further information on submitting testcases and implementation reports
		can be found from on the CSS Working Group’s website at <a href="http://www.w3.org/Style/CSS/Test/">http://www.w3.org/Style/CSS/Test/</a>.
		Questions should be directed to the <a href="http://lists.w3.org/Archives/Public/public-css-testsuite">public-css-testsuite@w3.org</a> mailing list. 
<script src="https://www.w3.org/scripts/TR/2016/fixup.js"></script>
  </p>
  <h2 class="no-num no-ref heading settled" id="index"><span class="content">Index</span><a class="self-link" href="#index"></a></h2>
  <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="content">Terms defined by this specification</span><a class="self-link" href="#index-defined-here"></a></h3>
  <ul class="index">
   <li>
    &lt;basic-shape>
    <ul>
     <li><a href="#typedef-basic-shape">(type)</a><span>, in §3</span>
     <li><a href="#valdef-shape-outside-basic-shape">value for shape-outside</a><span>, in §6.1</span>
    </ul>
   <li><a href="#valdef-shape-box-border-box">border-box</a><span>, in §5</span>
   <li><a href="#funcdef-circle">circle()</a><span>, in §3.1</span>
   <li><a href="#closest-side">closest-side</a><span>, in §3.1</span>
   <li><a href="#valdef-shape-box-content-box">content-box</a><span>, in §5</span>
   <li><a href="#funcdef-ellipse">ellipse()</a><span>, in §3.1</span>
   <li><a href="#farthest-side">farthest-side</a><span>, in §3.1</span>
   <li><a href="#float-area">Float area</a><span>, in §1.4</span>
   <li><a href="#valdef-shape-outside-image">&lt;image></a><span>, in §6.1</span>
   <li><a href="#funcdef-inset">inset()</a><span>, in §3.1</span>
   <li><a href="#valdef-shape-margin-length-percentage">&lt;length-percentage></a><span>, in §6.3</span>
   <li><a href="#valdef-shape-box-margin-box">margin-box</a><span>, in §5</span>
   <li><a href="#valdef-shape-outside-none">none</a><span>, in §6.1</span>
   <li><a href="#valdef-shape-image-threshold-number">&lt;number></a><span>, in §6.2</span>
   <li><a href="#valdef-shape-box-padding-box">padding-box</a><span>, in §5</span>
   <li><a href="#funcdef-path">path()</a><span>, in §3.1</span>
   <li><a href="#funcdef-polygon">polygon()</a><span>, in §3.1</span>
   <li><a href="#reference-box">reference box</a><span>, in §3</span>
   <li><a href="#typedef-shape-box">&lt;shape-box></a><span>, in §5</span>
   <li><a href="#propdef-shape-image-threshold">shape-image-threshold</a><span>, in §6.2</span>
   <li><a href="#propdef-shape-margin">shape-margin</a><span>, in §6.3</span>
   <li><a href="#propdef-shape-outside">shape-outside</a><span>, in §6.1</span>
   <li><a href="#typedef-shape-radius">&lt;shape-radius></a><span>, in §3.1</span>
   <li><a href="#valdef-path-string">&lt;string></a><span>, in §3.1</span>
   <li><a href="#wrap">wrap</a><span>, in §1.4</span>
   <li><a href="#wrap">wrapping</a><span>, in §1.4</span>
  </ul>
  <aside class="dfn-panel" data-for="term-for-typedef-alpha-value">
   <a href="https://drafts.csswg.org/css-color-4/#typedef-alpha-value">https://drafts.csswg.org/css-color-4/#typedef-alpha-value</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-typedef-alpha-value">6.2. 
Choosing Image Pixels: the shape-image-threshold property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-clip-path">
   <a href="https://drafts.fxtf.org/css-masking-1/#propdef-clip-path">https://drafts.fxtf.org/css-masking-1/#propdef-clip-path</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-clip-path">3.1. 
Supported Shapes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-valdef-clip-rule-evenodd">
   <a href="https://drafts.fxtf.org/css-masking-1/#valdef-clip-rule-evenodd">https://drafts.fxtf.org/css-masking-1/#valdef-clip-rule-evenodd</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-clip-rule-evenodd">3.1. 
Supported Shapes</a> <a href="#ref-for-valdef-clip-rule-evenodd①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-valdef-clip-rule-nonzero">
   <a href="https://drafts.fxtf.org/css-masking-1/#valdef-clip-rule-nonzero">https://drafts.fxtf.org/css-masking-1/#valdef-clip-rule-nonzero</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-clip-rule-nonzero">3.1. 
Supported Shapes</a> <a href="#ref-for-valdef-clip-rule-nonzero①">(2)</a> <a href="#ref-for-valdef-clip-rule-nonzero②">(3)</a> <a href="#ref-for-valdef-clip-rule-nonzero③">(4)</a>
    <li><a href="#ref-for-valdef-clip-rule-nonzero④">3.4. 
Interpolation of Basic Shapes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-number-value">
   <a href="https://drafts.csswg.org/css-values-3/#number-value">https://drafts.csswg.org/css-values-3/#number-value</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-number-value">6.2. 
Choosing Image Pixels: the shape-image-threshold property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-string-value">
   <a href="https://drafts.csswg.org/css-values-3/#string-value">https://drafts.csswg.org/css-values-3/#string-value</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-string-value">3.1. 
Supported Shapes</a> <a href="#ref-for-string-value①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-typedef-length-percentage">
   <a href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage">https://drafts.csswg.org/css-values-4/#typedef-length-percentage</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-typedef-length-percentage">3.1. 
Supported Shapes</a> <a href="#ref-for-typedef-length-percentage①">(2)</a> <a href="#ref-for-typedef-length-percentage②">(3)</a> <a href="#ref-for-typedef-length-percentage③">(4)</a>
    <li><a href="#ref-for-typedef-length-percentage④">3.2. 
Computed Values of Basic Shapes</a>
    <li><a href="#ref-for-typedef-length-percentage⑤">6.3. 
Expanding a Shape: the shape-margin property</a> <a href="#ref-for-typedef-length-percentage⑥">(2)</a> <a href="#ref-for-typedef-length-percentage⑦">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-typedef-position">
   <a href="https://drafts.csswg.org/css-values-4/#typedef-position">https://drafts.csswg.org/css-values-4/#typedef-position</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-typedef-position">3.1. 
Supported Shapes</a> <a href="#ref-for-typedef-position①">(2)</a>
    <li><a href="#ref-for-typedef-position②">3.2. 
Computed Values of Basic Shapes</a>
    <li><a href="#ref-for-typedef-position③">3.3. 
Serialization of Basic Shapes</a> <a href="#ref-for-typedef-position④">(2)</a> <a href="#ref-for-typedef-position⑤">(3)</a> <a href="#ref-for-typedef-position⑥">(4)</a> <a href="#ref-for-typedef-position⑦">(5)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-css-wide-keywords">
   <a href="https://drafts.csswg.org/css-values-4/#css-wide-keywords">https://drafts.csswg.org/css-values-4/#css-wide-keywords</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-css-wide-keywords">1.2. Values</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-comb-one">
   <a href="https://drafts.csswg.org/css-values-4/#comb-one">https://drafts.csswg.org/css-values-4/#comb-one</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-comb-one">6.1. 
Float Area Shape: the shape-outside property</a> <a href="#ref-for-comb-one①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-comb-any">
   <a href="https://drafts.csswg.org/css-values-4/#comb-any">https://drafts.csswg.org/css-values-4/#comb-any</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-comb-any">6.1. 
Float Area Shape: the shape-outside property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-inline-size">
   <a href="https://drafts.csswg.org/css-writing-modes-4/#inline-size">https://drafts.csswg.org/css-writing-modes-4/#inline-size</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-inline-size">6.3. 
Expanding a Shape: the shape-margin property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-margin">
   <a href="https://drafts.csswg.org/css2/box.html#propdef-margin">https://drafts.csswg.org/css2/box.html#propdef-margin</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-margin">3.1. 
Supported Shapes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-typedef-image">
   <a href="https://drafts.csswg.org/css-images-3/#typedef-image">https://drafts.csswg.org/css-images-3/#typedef-image</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-typedef-image">4. 
Shapes from Image</a>
    <li><a href="#ref-for-typedef-image①">6.1. 
Float Area Shape: the shape-outside property</a> <a href="#ref-for-typedef-image②">(2)</a> <a href="#ref-for-typedef-image③">(3)</a> <a href="#ref-for-typedef-image④">(4)</a>
    <li><a href="#ref-for-typedef-image⑤">7. Privacy and Security Considerations</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-typedef-box">
   <a href="https://drafts.csswg.org/css-backgrounds-3/#typedef-box">https://drafts.csswg.org/css-backgrounds-3/#typedef-box</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-typedef-box">5. 
Shapes from Box Values</a> <a href="#ref-for-typedef-box①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-background-clip">
   <a href="https://drafts.csswg.org/css-backgrounds-3/#propdef-background-clip">https://drafts.csswg.org/css-backgrounds-3/#propdef-background-clip</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-background-clip">6.1. 
Float Area Shape: the shape-outside property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-border-radius">
   <a href="https://drafts.csswg.org/css-backgrounds-3/#propdef-border-radius">https://drafts.csswg.org/css-backgrounds-3/#propdef-border-radius</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-border-radius">3.1. 
Supported Shapes</a> <a href="#ref-for-propdef-border-radius①">(2)</a> <a href="#ref-for-propdef-border-radius②">(3)</a>
    <li><a href="#ref-for-propdef-border-radius③">3.2. 
Computed Values of Basic Shapes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-margin-box">
   <a href="https://drafts.csswg.org/css-box-3/#margin-box">https://drafts.csswg.org/css-box-3/#margin-box</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-margin-box">1.4. 
Terminology</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-FillRuleProperty">
   <a href="https://svgwg.org/svg2-draft/painting.html#FillRuleProperty">https://svgwg.org/svg2-draft/painting.html#FillRuleProperty</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-FillRuleProperty">3.1. 
Supported Shapes</a> <a href="#ref-for-FillRuleProperty①">(2)</a> <a href="#ref-for-FillRuleProperty②">(3)</a> <a href="#ref-for-FillRuleProperty③">(4)</a>
    <li><a href="#ref-for-FillRuleProperty④">3.4. 
Interpolation of Basic Shapes</a>
   </ul>
  </aside>
  <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span class="content">Terms defined by reference</span><a class="self-link" href="#index-defined-elsewhere"></a></h3>
  <ul class="index">
   <li>
    <a data-link-type="biblio">[css-color-4]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-typedef-alpha-value" style="color:initial">&lt;alpha-value></span>
    </ul>
   <li>
    <a data-link-type="biblio">[CSS-MASKING]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-propdef-clip-path" style="color:initial">clip-path</span>
     <li><span class="dfn-paneled" id="term-for-valdef-clip-rule-evenodd" style="color:initial">evenodd</span>
     <li><span class="dfn-paneled" id="term-for-valdef-clip-rule-nonzero" style="color:initial">nonzero</span>
    </ul>
   <li>
    <a data-link-type="biblio">[CSS-VALUES-3]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-number-value" style="color:initial">&lt;number></span>
     <li><span class="dfn-paneled" id="term-for-string-value" style="color:initial">&lt;string></span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-values-4]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-typedef-length-percentage" style="color:initial">&lt;length-percentage></span>
     <li><span class="dfn-paneled" id="term-for-typedef-position" style="color:initial">&lt;position></span>
     <li><span class="dfn-paneled" id="term-for-css-wide-keywords" style="color:initial">css-wide keywords</span>
     <li><span class="dfn-paneled" id="term-for-comb-one" style="color:initial">|</span>
     <li><span class="dfn-paneled" id="term-for-comb-any" style="color:initial">||</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-writing-modes-4]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-inline-size" style="color:initial">inline size</span>
    </ul>
   <li>
    <a data-link-type="biblio">[CSS2]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-propdef-margin" style="color:initial">margin</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css3-images]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-typedef-image" style="color:initial">&lt;image></span>
    </ul>
   <li>
    <a data-link-type="biblio">[CSS3BG]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-typedef-box" style="color:initial">&lt;box></span>
     <li><span class="dfn-paneled" id="term-for-propdef-background-clip" style="color:initial">background-clip</span>
     <li><span class="dfn-paneled" id="term-for-propdef-border-radius" style="color:initial">border-radius</span>
    </ul>
   <li>
    <a data-link-type="biblio">[CSS3BOX]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-margin-box" style="color:initial">margin box</span>
    </ul>
   <li>
    <a data-link-type="biblio">[SVG2]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-FillRuleProperty" style="color:initial">fill-rule</span>
    </ul>
  </ul>
  <h2 class="no-num no-ref heading settled" id="references"><span class="content">References</span><a class="self-link" href="#references"></a></h2>
  <h3 class="no-num no-ref heading settled" id="normative"><span class="content">Normative References</span><a class="self-link" href="#normative"></a></h3>
  <dl>
   <dt id="biblio-css-color-4">[CSS-COLOR-4]
   <dd>Tab Atkins Jr.; Chris Lilley. <a href="https://www.w3.org/TR/css-color-4/">CSS Color Module Level 4</a>. 5 March 2019. WD. URL: <a href="https://www.w3.org/TR/css-color-4/">https://www.w3.org/TR/css-color-4/</a>
   <dt id="biblio-css-masking">[CSS-MASKING]
   <dd>Dirk Schulze; Brian Birtles; Tab Atkins Jr.. <a href="https://www.w3.org/TR/css-masking-1/">CSS Masking Module Level 1</a>. 26 August 2014. CR. URL: <a href="https://www.w3.org/TR/css-masking-1/">https://www.w3.org/TR/css-masking-1/</a>
   <dt id="biblio-css-values-3">[CSS-VALUES-3]
   <dd>Tab Atkins Jr.; Elika Etemad. <a href="https://www.w3.org/TR/css-values-3/">CSS Values and Units Module Level 3</a>. 31 January 2019. CR. URL: <a href="https://www.w3.org/TR/css-values-3/">https://www.w3.org/TR/css-values-3/</a>
   <dt id="biblio-css-values-4">[CSS-VALUES-4]
   <dd>Tab Atkins Jr.; Elika Etemad. <a href="https://www.w3.org/TR/css-values-4/">CSS Values and Units Module Level 4</a>. 31 January 2019. WD. URL: <a href="https://www.w3.org/TR/css-values-4/">https://www.w3.org/TR/css-values-4/</a>
   <dt id="biblio-css-writing-modes-4">[CSS-WRITING-MODES-4]
   <dd>Elika Etemad; Koji Ishii. <a href="https://www.w3.org/TR/css-writing-modes-4/">CSS Writing Modes Level 4</a>. 24 May 2018. CR. URL: <a href="https://www.w3.org/TR/css-writing-modes-4/">https://www.w3.org/TR/css-writing-modes-4/</a>
   <dt id="biblio-css2">[CSS2]
   <dd>Bert Bos; et al. <a href="https://www.w3.org/TR/CSS2/">Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification</a>. 7 June 2011. REC. URL: <a href="https://www.w3.org/TR/CSS2/">https://www.w3.org/TR/CSS2/</a>
   <dt id="biblio-css3-images">[CSS3-IMAGES]
   <dd>Elika Etemad; Tab Atkins Jr.. <a href="https://www.w3.org/TR/css3-images/">CSS Image Values and Replaced Content Module Level 3</a>. 17 April 2012. CR. URL: <a href="https://www.w3.org/TR/css3-images/">https://www.w3.org/TR/css3-images/</a>
   <dt id="biblio-css3bg">[CSS3BG]
   <dd>Bert Bos; Elika Etemad; Brad Kemper. <a href="https://www.w3.org/TR/css-backgrounds-3/">CSS Backgrounds and Borders Module Level 3</a>. 17 October 2017. CR. URL: <a href="https://www.w3.org/TR/css-backgrounds-3/">https://www.w3.org/TR/css-backgrounds-3/</a>
   <dt id="biblio-css3box">[CSS3BOX]
   <dd>Elika Etemad. <a href="https://www.w3.org/TR/css-box-3/">CSS Box Model Module Level 3</a>. 18 December 2018. WD. URL: <a href="https://www.w3.org/TR/css-box-3/">https://www.w3.org/TR/css-box-3/</a>
   <dt id="biblio-html5">[HTML5]
   <dd>Ian Hickson; et al. <a href="https://www.w3.org/TR/html5/">HTML5</a>. 27 March 2018. REC. URL: <a href="https://www.w3.org/TR/html5/">https://www.w3.org/TR/html5/</a>
   <dt id="biblio-rfc2119">[RFC2119]
   <dd>S. Bradner. <a href="https://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href="https://tools.ietf.org/html/rfc2119">https://tools.ietf.org/html/rfc2119</a>
   <dt id="biblio-svg2">[SVG2]
   <dd>Amelia Bellamy-Royds; et al. <a href="https://www.w3.org/TR/SVG2/">Scalable Vector Graphics (SVG) 2</a>. 4 October 2018. CR. URL: <a href="https://www.w3.org/TR/SVG2/">https://www.w3.org/TR/SVG2/</a>
  </dl>
  <h3 class="no-num no-ref heading settled" id="informative"><span class="content">Informative References</span><a class="self-link" href="#informative"></a></h3>
  <dl>
   <dt id="biblio-css3-exclusions">[CSS3-EXCLUSIONS]
   <dd>Rossen Atanassov; Vincent Hardy; Alan Stearns. <a href="https://www.w3.org/TR/css3-exclusions/">CSS Exclusions Module Level 1</a>. 15 January 2015. WD. URL: <a href="https://www.w3.org/TR/css3-exclusions/">https://www.w3.org/TR/css3-exclusions/</a>
   <dt id="biblio-css3-transitions">[CSS3-TRANSITIONS]
   <dd>David Baron; et al. <a href="https://www.w3.org/TR/css-transitions-1/">CSS Transitions</a>. 11 October 2018. WD. URL: <a href="https://www.w3.org/TR/css-transitions-1/">https://www.w3.org/TR/css-transitions-1/</a>
  </dl>
  <h2 class="no-num no-ref heading settled" id="property-index"><span class="content">Property Index</span><a class="self-link" href="#property-index"></a></h2>
  <div class="big-element-wrapper">
   <table class="index">
    <thead>
     <tr>
      <th scope="col">Name
      <th scope="col">Value
      <th scope="col">Initial
      <th scope="col">Applies to
      <th scope="col">Inh.
      <th scope="col">%ages
      <th scope="col">Anim­ation type
      <th scope="col">Canonical order
      <th scope="col">Com­puted value
    <tbody>
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-shape-image-threshold" id="ref-for-propdef-shape-image-threshold⑥">shape-image-threshold</a>
      <td>&lt;alpha-value>
      <td>0
      <td>floats
      <td>no
      <td>n/a
      <td>by computed value
      <td>per grammar
      <td>specified number, clamped to the range [0,1]
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-shape-margin" id="ref-for-propdef-shape-margin⑨">shape-margin</a>
      <td>&lt;length-percentage>
      <td>0
      <td>floats
      <td>no
      <td>refer to the inline size of the containing block
      <td>by computed value
      <td>per grammar
      <td>computed &lt;length-percentage> value
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-shape-outside" id="ref-for-propdef-shape-outside①⑥">shape-outside</a>
      <td>none | [ &lt;basic-shape> || &lt;shape-box> ] | &lt;image>
      <td>none
      <td>floats
      <td>no
      <td>n/a
      <td>as defined for &lt;basic-shape>, otherwise discrete
      <td>per grammar
      <td>as defined for &lt;basic-shape> (with &lt;shape-box> following, if supplied); else the computed &lt;image>; else the keyword as specified
   </table>
  </div>
  <aside class="dfn-panel" data-for="wrap">
   <b><a href="#wrap">#wrap</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-wrap①">1. 
Introduction</a>
    <li><a href="#ref-for-wrap②">1.4. 
Terminology</a> <a href="#ref-for-wrap③">(2)</a> <a href="#ref-for-wrap④">(3)</a> <a href="#ref-for-wrap⑤">(4)</a> <a href="#ref-for-wrap⑥">(5)</a>
    <li><a href="#ref-for-wrap⑦">2. 
Relation to the box model and float behavior</a> <a href="#ref-for-wrap⑧">(2)</a> <a href="#ref-for-wrap⑨">(3)</a> <a href="#ref-for-wrap①⓪">(4)</a> <a href="#ref-for-wrap①①">(5)</a> <a href="#ref-for-wrap①②">(6)</a>
    <li><a href="#ref-for-wrap①③">6.3. 
Expanding a Shape: the shape-margin property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="float-area">
   <b><a href="#float-area">#float-area</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-float-area">1. 
Introduction</a> <a href="#ref-for-float-area①">(2)</a>
    <li><a href="#ref-for-float-area②">1.4. 
Terminology</a> <a href="#ref-for-float-area③">(2)</a> <a href="#ref-for-float-area④">(3)</a> <a href="#ref-for-float-area⑤">(4)</a> <a href="#ref-for-float-area⑥">(5)</a> <a href="#ref-for-float-area⑦">(6)</a>
    <li><a href="#ref-for-float-area⑧">2. 
Relation to the box model and float behavior</a> <a href="#ref-for-float-area⑨">(2)</a> <a href="#ref-for-float-area①⓪">(3)</a> <a href="#ref-for-float-area①①">(4)</a> <a href="#ref-for-float-area①②">(5)</a> <a href="#ref-for-float-area①③">(6)</a> <a href="#ref-for-float-area①④">(7)</a> <a href="#ref-for-float-area①⑤">(8)</a> <a href="#ref-for-float-area①⑥">(9)</a> <a href="#ref-for-float-area①⑦">(10)</a>
    <li><a href="#ref-for-float-area①⑧">4. 
Shapes from Image</a> <a href="#ref-for-float-area①⑨">(2)</a>
    <li><a href="#ref-for-float-area②⓪">6. 
Declaring Shapes</a>
    <li><a href="#ref-for-float-area②①">6.1. 
Float Area Shape: the shape-outside property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="typedef-basic-shape">
   <b><a href="#typedef-basic-shape">#typedef-basic-shape</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-typedef-basic-shape">3. 
Basic Shapes</a>
    <li><a href="#ref-for-typedef-basic-shape①">3.1. 
Supported Shapes</a>
    <li><a href="#ref-for-typedef-basic-shape②">3.2. 
Computed Values of Basic Shapes</a>
    <li><a href="#ref-for-typedef-basic-shape③">3.3. 
Serialization of Basic Shapes</a>
    <li><a href="#ref-for-typedef-basic-shape④">6.1. 
Float Area Shape: the shape-outside property</a> <a href="#ref-for-typedef-basic-shape⑤">(2)</a> <a href="#ref-for-typedef-basic-shape⑥">(3)</a> <a href="#ref-for-typedef-basic-shape⑦">(4)</a> <a href="#ref-for-typedef-basic-shape⑧">(5)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="reference-box">
   <b><a href="#reference-box">#reference-box</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-reference-box">3. 
Basic Shapes</a> <a href="#ref-for-reference-box①">(2)</a>
    <li><a href="#ref-for-reference-box②">3.1. 
Supported Shapes</a> <a href="#ref-for-reference-box③">(2)</a> <a href="#ref-for-reference-box④">(3)</a> <a href="#ref-for-reference-box⑤">(4)</a>
    <li><a href="#ref-for-reference-box⑥">3.4. 
Interpolation of Basic Shapes</a>
    <li><a href="#ref-for-reference-box⑦">6.1. 
Float Area Shape: the shape-outside property</a> <a href="#ref-for-reference-box⑧">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="funcdef-inset">
   <b><a href="#funcdef-inset">#funcdef-inset</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-funcdef-inset">3.2. 
Computed Values of Basic Shapes</a>
    <li><a href="#ref-for-funcdef-inset①">3.4. 
Interpolation of Basic Shapes</a>
    <li><a href="#ref-for-funcdef-inset②">6.1. 
Float Area Shape: the shape-outside property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="funcdef-circle">
   <b><a href="#funcdef-circle">#funcdef-circle</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-funcdef-circle">3.2. 
Computed Values of Basic Shapes</a>
    <li><a href="#ref-for-funcdef-circle①">3.4. 
Interpolation of Basic Shapes</a>
    <li><a href="#ref-for-funcdef-circle②">6.1. 
Float Area Shape: the shape-outside property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="funcdef-ellipse">
   <b><a href="#funcdef-ellipse">#funcdef-ellipse</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-funcdef-ellipse">3.2. 
Computed Values of Basic Shapes</a>
    <li><a href="#ref-for-funcdef-ellipse①">3.4. 
Interpolation of Basic Shapes</a>
    <li><a href="#ref-for-funcdef-ellipse②">6.1. 
Float Area Shape: the shape-outside property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="funcdef-polygon">
   <b><a href="#funcdef-polygon">#funcdef-polygon</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-funcdef-polygon">3.4. 
Interpolation of Basic Shapes</a>
    <li><a href="#ref-for-funcdef-polygon①">6.1. 
Float Area Shape: the shape-outside property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="typedef-shape-radius">
   <b><a href="#typedef-shape-radius">#typedef-shape-radius</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-typedef-shape-radius">3.1. 
Supported Shapes</a> <a href="#ref-for-typedef-shape-radius①">(2)</a> <a href="#ref-for-typedef-shape-radius②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="closest-side">
   <b><a href="#closest-side">#closest-side</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-closest-side">3.4. 
Interpolation of Basic Shapes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="farthest-side">
   <b><a href="#farthest-side">#farthest-side</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-farthest-side">3.4. 
Interpolation of Basic Shapes</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="typedef-shape-box">
   <b><a href="#typedef-shape-box">#typedef-shape-box</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-typedef-shape-box">5. 
Shapes from Box Values</a> <a href="#ref-for-typedef-shape-box①">(2)</a>
    <li><a href="#ref-for-typedef-shape-box②">6.1. 
Float Area Shape: the shape-outside property</a> <a href="#ref-for-typedef-shape-box③">(2)</a> <a href="#ref-for-typedef-shape-box④">(3)</a> <a href="#ref-for-typedef-shape-box⑤">(4)</a> <a href="#ref-for-typedef-shape-box⑥">(5)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="valdef-shape-box-margin-box">
   <b><a href="#valdef-shape-box-margin-box">#valdef-shape-box-margin-box</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-shape-box-margin-box">1.4. 
Terminology</a>
    <li><a href="#ref-for-valdef-shape-box-margin-box①">5. 
Shapes from Box Values</a> <a href="#ref-for-valdef-shape-box-margin-box②">(2)</a> <a href="#ref-for-valdef-shape-box-margin-box③">(3)</a>
    <li><a href="#ref-for-valdef-shape-box-margin-box④">6.1. 
Float Area Shape: the shape-outside property</a> <a href="#ref-for-valdef-shape-box-margin-box⑤">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="valdef-shape-box-border-box">
   <b><a href="#valdef-shape-box-border-box">#valdef-shape-box-border-box</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-shape-box-border-box">5. 
Shapes from Box Values</a>
    <li><a href="#ref-for-valdef-shape-box-border-box①">6.1. 
Float Area Shape: the shape-outside property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="valdef-shape-box-padding-box">
   <b><a href="#valdef-shape-box-padding-box">#valdef-shape-box-padding-box</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-shape-box-padding-box">5. 
Shapes from Box Values</a>
    <li><a href="#ref-for-valdef-shape-box-padding-box①">6.1. 
Float Area Shape: the shape-outside property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="valdef-shape-box-content-box">
   <b><a href="#valdef-shape-box-content-box">#valdef-shape-box-content-box</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-shape-box-content-box">5. 
Shapes from Box Values</a>
    <li><a href="#ref-for-valdef-shape-box-content-box①">6.1. 
Float Area Shape: the shape-outside property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="propdef-shape-outside">
   <b><a href="#propdef-shape-outside">#propdef-shape-outside</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-shape-outside">1. 
Introduction</a> <a href="#ref-for-propdef-shape-outside①">(2)</a>
    <li><a href="#ref-for-propdef-shape-outside②">1.4. 
Terminology</a>
    <li><a href="#ref-for-propdef-shape-outside③">2. 
Relation to the box model and float behavior</a> <a href="#ref-for-propdef-shape-outside④">(2)</a> <a href="#ref-for-propdef-shape-outside⑤">(3)</a>
    <li><a href="#ref-for-propdef-shape-outside⑥">3.1. 
Supported Shapes</a>
    <li><a href="#ref-for-propdef-shape-outside⑦">4. 
Shapes from Image</a> <a href="#ref-for-propdef-shape-outside⑧">(2)</a>
    <li><a href="#ref-for-propdef-shape-outside⑨">6. 
Declaring Shapes</a> <a href="#ref-for-propdef-shape-outside①⓪">(2)</a>
    <li><a href="#ref-for-propdef-shape-outside①①">6.1. 
Float Area Shape: the shape-outside property</a> <a href="#ref-for-propdef-shape-outside①②">(2)</a>
    <li><a href="#ref-for-propdef-shape-outside①③">6.3. 
Expanding a Shape: the shape-margin property</a> <a href="#ref-for-propdef-shape-outside①④">(2)</a>
    <li><a href="#ref-for-propdef-shape-outside①⑤">7. Privacy and Security Considerations</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="valdef-shape-outside-none">
   <b><a href="#valdef-shape-outside-none">#valdef-shape-outside-none</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-shape-outside-none">6.1. 
Float Area Shape: the shape-outside property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="propdef-shape-image-threshold">
   <b><a href="#propdef-shape-image-threshold">#propdef-shape-image-threshold</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-shape-image-threshold">4. 
Shapes from Image</a> <a href="#ref-for-propdef-shape-image-threshold①">(2)</a> <a href="#ref-for-propdef-shape-image-threshold②">(3)</a>
    <li><a href="#ref-for-propdef-shape-image-threshold③">6.1. 
Float Area Shape: the shape-outside property</a>
    <li><a href="#ref-for-propdef-shape-image-threshold④">6.2. 
Choosing Image Pixels: the shape-image-threshold property</a> <a href="#ref-for-propdef-shape-image-threshold⑤">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="propdef-shape-margin">
   <b><a href="#propdef-shape-margin">#propdef-shape-margin</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-shape-margin">4. 
Shapes from Image</a>
    <li><a href="#ref-for-propdef-shape-margin①">6. 
Declaring Shapes</a> <a href="#ref-for-propdef-shape-margin②">(2)</a>
    <li><a href="#ref-for-propdef-shape-margin③">6.3. 
Expanding a Shape: the shape-margin property</a> <a href="#ref-for-propdef-shape-margin④">(2)</a> <a href="#ref-for-propdef-shape-margin⑤">(3)</a> <a href="#ref-for-propdef-shape-margin⑥">(4)</a> <a href="#ref-for-propdef-shape-margin⑦">(5)</a> <a href="#ref-for-propdef-shape-margin⑧">(6)</a>
   </ul>
  </aside>
<script>/* script-dfn-panel */

document.body.addEventListener("click", function(e) {
    var queryAll = function(sel) { return [].slice.call(document.querySelectorAll(sel)); }
    // Find the dfn element or panel, if any, that was clicked on.
    var el = e.target;
    var target;
    var hitALink = false;
    while(el.parentElement) {
        if(el.tagName == "A") {
            // Clicking on a link in a <dfn> shouldn't summon the panel
            hitALink = true;
        }
        if(el.classList.contains("dfn-paneled")) {
            target = "dfn";
            break;
        }
        if(el.classList.contains("dfn-panel")) {
            target = "dfn-panel";
            break;
        }
        el = el.parentElement;
    }
    if(target != "dfn-panel") {
        // Turn off any currently "on" or "activated" panels.
        queryAll(".dfn-panel.on, .dfn-panel.activated").forEach(function(el){
            el.classList.remove("on");
            el.classList.remove("activated");
        });
    }
    if(target == "dfn" && !hitALink) {
        // open the panel
        var dfnPanel = document.querySelector(".dfn-panel[data-for='" + el.id + "']");
        if(dfnPanel) {
            dfnPanel.classList.add("on");
            var rect = el.getBoundingClientRect();
            dfnPanel.style.left = window.scrollX + rect.right + 5 + "px";
            dfnPanel.style.top = window.scrollY + rect.top + "px";
            var panelRect = dfnPanel.getBoundingClientRect();
            var panelWidth = panelRect.right - panelRect.left;
            if(panelRect.right > document.body.scrollWidth && (rect.left - (panelWidth + 5)) > 0) {
                // Reposition, because the panel is overflowing
                dfnPanel.style.left = window.scrollX + rect.left - (panelWidth + 5) + "px";
            }
        } else {
            console.log("Couldn't find .dfn-panel[data-for='" + el.id + "']");
        }
    } else if(target == "dfn-panel") {
        // Switch it to "activated" state, which pins it.
        el.classList.add("activated");
        el.style.left = null;
        el.style.top = null;
    }

});
</script>